Skip to content

Deprecate sorted set commands - #3913

Merged
a-TODO-rov merged 3 commits into
redis:mainfrom
Dgramada:feature/deprecate-Sorted-Set-Commands
Sep 15, 2026
Merged

a-TODO-rov merged 3 commits into
redis:mainfrom
Dgramada:feature/deprecate-Sorted-Set-Commands

Conversation

@Dgramada

@Dgramada Dgramada commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #3795 and deprecates the following Redis commands:

  • ZRANGEBYLEX
  • ZRANGEBYSCORE
  • ZREVRANGE
  • ZREVRANGEBYLEX
  • ZREVRANGEBYSCORE

Note

Low Risk
Deprecation and documentation only—runtime behavior is unchanged—but the broad public API surface will surface compiler warnings for existing callers until they migrate.

Overview
Marks the pre–Redis 6.2 sorted-set range APIs as deprecated across Lettuce’s command surfaces (async/reactive implementations and sorted-set command interfaces), steering callers to the unified zrange / zrangeWithScores overloads that take a ZRange selector (ByIndex, ByScore, ByLex) with rev() and limit(...) where applicable.

Deprecated families include zrangebylex, zrangebyscore, zrangebyscoreWithScores, zrevrange, zrevrangeWithScores, zrevrangebylex, zrevrangebyscore, and zrevrangebyscoreWithScores, including streaming-channel overloads. Several Range/Limit overloads that were not previously annotated are now @Deprecated as well.

Javadoc on each method is expanded to name the replacement overload and how to map string boundaries to Range.Boundary; removals are planned in a future major release. docs/new-features.md documents the change for 7.8, including that the Kotlin coroutine API should use the ZRange-based functions instead of the removed legacy commands.

Reviewed by Cursor Bugbot for commit 9fd383b. Bugbot is set up for automated code reviews on this repo. Configure here.

@Dgramada
Dgramada requested a review from a-TODO-rov September 14, 2026 10:17
@Dgramada Dgramada linked an issue Sep 14, 2026 that may be closed by this pull request

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8e540ef88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/new-features.md Resolved
Comment on lines +691 to +692
* @deprecated since 7.8, use {@link #zrange(Object, ZRange.ByLex)} instead. This command is deprecated by Redis since
* version 6.2.0.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify replacements with their Redis version requirement

When a client connects to Redis before 6.2, following this replacement advice sends the unified ZRANGE ... BYLEX/BYSCORE/REV syntax that those servers do not support, resulting in a command error. Because Lettuce still targets Redis 2.6+, qualify these recommendations as applying to Redis 6.2 and later and tell users of older servers to retain the legacy methods.

AGENTS.md reference: AGENTS.md:L61-L62

Useful? React with 👍 / 👎.

* @deprecated Use {@link #zrangebyscore(ValueStreamingChannel, java.lang.Object, Range)}.
* @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by
* {@link #zrangebyscore}.
* @deprecated since 7.8, use {@link #zrange(Object, ZRange.ByScore)} instead. This command is deprecated by Redis since

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the original reactive deprecation date

For callers of the reactive streaming-channel overloads, these methods were already documented as deprecated since 6.0, but the replacement text now reports that deprecation began in 7.8. This erases the actual API lifecycle and can lead maintainers or users to calculate an incorrect removal window; retain since 6.0 while updating the recommended replacement.

AGENTS.md reference: AGENTS.md:L157-L158

Useful? React with 👍 / 👎.

Comment on lines 1214 to 1216
* @deprecated since 7.8, use {@link #zrange(Object, ZRange.ByIndex)} with {@link ZRange.ByIndex#rev()} instead. This
* command is deprecated by Redis since version 6.2.0.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge State the removal schedule in deprecation tags

The new public-API deprecation tags stop after naming the replacement and Redis deprecation version, omitting the repository-required scheduled for removal in a future major release clause. Add that lifecycle statement consistently across these newly deprecated methods so generated API documentation follows the house deprecation contract.

AGENTS.md reference: AGENTS.md:L157-L158

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T08:52:55.000628Z 9fd383b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Dgramada and others added 2 commits September 15, 2026 10:50
Signed-off-by: yordantsintsov <yordan.tsintsov@gmail.com>
@a-TODO-rov
a-TODO-rov force-pushed the feature/deprecate-Sorted-Set-Commands branch from e80ea91 to cba72a8 Compare September 15, 2026 07:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cba72a8832

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* @param max max score.
* @return List&lt;V&gt; array-reply list of elements in the specified range.
* @deprecated Use {@link #zrangebylex(java.lang.Object, Range)}.
* @deprecated since 7.8, use {@link #zrange(Object, ZRange.ByLex)} instead; scheduled for removal in a future major

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the original Java deprecation date

This overload was already annotated @Deprecated in the immediate parent, so documenting its deprecation as beginning in 7.8 gives callers an incorrect lifecycle and removal timeline. The same applies to the other previously deprecated non-Range overloads mirrored across the sync, async, and node-selection APIs; retain or determine their original deprecation version while updating the replacement guidance.

Useful? React with 👍 / 👎.

@a-TODO-rov
a-TODO-rov merged commit 2748516 into redis:main Sep 15, 2026
14 of 16 checks passed
@Dgramada
Dgramada deleted the feature/deprecate-Sorted-Set-Commands branch September 15, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate Sorted-Set Commands After ZRANGE Replacement

2 participants

⌂ 换网址