Repository navigation
[Redis 8.12] Support set member expiration (SME) commands - #4828
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afddc1ee6e
ℹ️ 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".
|
|
||
| private Keyword condition; | ||
|
|
||
| public static SAddExParams sAddExParams() { |
There was a problem hiding this comment.
Add @SInCE to the new parameter methods
The factory is new public API, as are mnx() and mxx(), but only the class-level Javadoc carries @since; generated method-level API documentation therefore cannot identify when these entry points were added. Add @since 8.1 to each of these three public methods.
AGENTS.md reference: AGENTS.md:L27-L31
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba5471e6b4
ℹ️ 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".
| * The single integer of a one-element integer array reply, for the single-member variants of | ||
| * commands that reply with one integer per member (e.g. {@code SEXPIRE key 10 MEMBERS 1 m}). | ||
| */ | ||
| public static final Builder<Long> LONG_FROM_LIST = new Builder<Long>() { |
There was a problem hiding this comment.
Add @SInCE to the new response builder
When the 8.1 API documentation is generated, the newly exposed public LONG_FROM_LIST builder has no @since 8.1 tag, so consumers cannot determine when this API became available; add the tag to this declaration.
AGENTS.md reference: AGENTS.md:L27-L31
Useful? React with 👍 / 👎.
Summary
Adds the ten set member expiration commands introduced in Redis 8.12:
SEXPIRE,SPEXPIRE,SEXPIREAT,SPEXPIREAT,STTL,SPTTL,SEXPIRETIME,SPEXPIRETIME,SPERSISTandSADDEX. Every command comes in a multi-member form and a single-member convenience form, on the String and binary APIs, in pipelines and transactions, and on the legacyJedisclient.Key Decisions & Assumptions
List<Long>, and the*expire*commands take an optionalExpiryOption(NX/XX/GT/LT) overload instead of a dedicated params class.sexpire(key, seconds, member),sttl(key, member),saddex(key, params, member), and so on) return a plainlonginstead of a one-element list. They send the sameMEMBERS 1 <member>wire form and unwrap the reply with a newBuilderFactory.LONG_FROM_LISTbuilder, so callers with one member avoid the list boilerplate.SADDEXgets aSAddExParamsclass that extendsBaseSetExParamsforex/px/exAt/pxAt/keepTtland addsmnx()/mxx(). Each group is a last-call-wins slot, and the command appends theMEMBERS <count>block itself.@since 8.1.Behavioral / Conceptual Changes
sunionstorekeeps the farthest,sinterstorethe nearest,sdiffstorethe first set's, andsmovemoves the member with its expiration.Testing
Unit tests cover argument encoding for every command, in both multi-member and single-member form, across
CommandObjects,UnifiedJedisandPipeliningBase, plusSAddExParamsordering, equality and overriding behavior. Integration tests in the shared set test base, theJedisset tests, and the pipeline tests exercise reply codes (-2/-1/0/1/2), per-member NX/XX/GT/LT semantics, past-time deletion,SADDEXconditions and the zero-modification reply, wrong-type errors, and the single-member variants returning the same codes as their list counterparts. They are gated with@EnabledOnCommand("SADDEX")so they skip on older servers.Note
Medium Risk
Broad new command surface and wire-format details tied to Redis 8.12 behavior; mistakes in argument ordering or reply parsing could confuse callers or break SME-heavy workloads, though the change is additive and guarded by integration tests.
Overview
Adds full client support for Redis 8.12 set member expiration: the
sexpire/spexpire/sexpireAt/spexpireAtfamily (with optionalExpiryOptionper member),sttl,spttl,sexpireTime,spexpireTime,spersist, andsaddexbacked by newSAddExParams(mnx/mxxplusex/px/exAt/pxAt/keepTtl).Multi-member calls return
List<Long>; single-member overloads return a plainlong, using newBuilderFactory.LONG_FROM_LISTto unwrap one-element array replies while still emittingMEMBERS 1 …on the wire. String and binary paths,UnifiedJedis, legacyJedis, pipelines, and the variousSet*command interfaces are all extended, andProtocolregisters the new commands plusMEMBERS,MNX, andMXXkeywords.Docs and semantics: 8.1.0 release notes describe the commands; Javadoc on
sdiffstore,sinterstore,sunionstore, andsmovecalls out how member expirations propagate in Redis 8.12. Tests add command-object, unified, pipeline, mocked, and integration coverage (including conditions, past-time deletes,saddexedge cases, wrong-type handling, and single-member variants), gated with@EnabledOnCommand("SADDEX")so they skip on servers without SME.Reviewed by Cursor Bugbot for commit 01c6beb. Bugbot is set up for automated code reviews on this repo. Configure here.