Repository navigation
Set member expiration - #15938
Merged
ronen-kalish merged 70 commits intoOct 28, 2026
Merged
Set member expiration#15938
Conversation
Add tests/unit/type/set-member-expire.tcl with the encoding matrix list, reply-code constants and helper procs (force encoding, create set, make members logically expired) that the SME behavior tests will build on. No tests yet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
db->subexpires only ever held hashes, and estore hardcoded the hash type in its eligibility checks and the bucket type's ExpireMeta accessor lived in t_hash.c. Move subexpiresBucketsType to estore.c and make it, and the eligibility checks in estoreAdd/Update/Remove, dispatch by object type through per-type functions (hashHasSubexpiry, setHasSubexpiry, hashGetExpireMeta, setGetExpireMeta) declared in server.h, so the type files never reference each other. The set functions are placeholders in the new t_set_expire.c: no set carries a member expiration yet, so they are unreachable. Hash behavior is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
activeSubexpiresCb asserted that every object in db->subexpires is a hash and called hashTypeExpire directly. Branch on the object type instead, and read the ExpireMeta through the bucket type's accessor, so another type can be added without touching the generic cycle. The set branch is a placeholder for now since no set is registered yet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ooks dbGenericDelete, dbSetValue, RENAME, MOVE and the key expiration setter removed an object from db->subexpires (and re-added it after reallocation or a move) only for hashes. Guard them with a typeMaySubexpire() test that covers sets as well, and rename the local variables that held the saved expire time accordingly. Behavior is unchanged: estoreRemove ignores objects without an ExpireMeta, and no set has one yet. COPY is left as is until setTypeDup can report a minimum expire. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Growing a key object to attach module key metadata removes the object from db->subexpires before the possible reallocation and re-adds it after, but only for hashes. Use typeMaySubexpire() so a set with member expirations keeps a valid registration too. No behavior change yet, as no set is registered. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
RESTORE and the RDB loader registered a freshly loaded object in db->subexpires only if it was a hash with a field expiration. Add kvobjGetMinSubexpiry(), which returns the earliest member or field expiration of a hash or set, and use it at both sites so a set can be registered the same way. The set side (setTypeGetMinExpire) is a placeholder that reports no expiration, so behavior is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
SetEntry is the member entry of hashtable-encoded sets that carry member expirations. A member without an expiration stays a plain sds; one with an expiration is an ExpireMeta prefix followed by the member sds (SDS_TYPE_8 or larger, so the header can hold an aux bit marking the prefix). The entry pointer is the member sds, as before, so it is still usable as the dict key and as an item of an ebuckets tree. The file provides create, add/remove expiration slot (reallocating), size, free, defrag and dismiss helpers, and a "setentry" C test registered in server.c covering all sds header types, the layout, ebuckets registration, the expiration slot transitions and defrag. Nothing uses it yet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Move parseExpireTime() from t_hash.c to expire.c as parseSubkeyExpireTime(), and the cap constant HFE_MAX_ABS_TIME_MSEC to server.h as SUBKEY_MAX_ABS_TIME_MSEC, so that the upcoming set member expiration commands apply exactly the same numeric rules and error replies as the hash field expiration commands. No behavior change. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add the ten commands SEXPIRE, SPEXPIRE, SEXPIREAT, SPEXPIREAT, STTL, SPTTL, SEXPIRETIME, SPEXPIRETIME, SPERSIST and SADDEX: command specs (since 8.12.0, modeled on the hash field expiration ones, SADDEX like HSETEX without a value, so arity -5, with the MNX and MXX options), the regenerated commands.def and the declarations. The argument parsing, validation and the replies for missing keys and wrong types follow the hash field expiration commands. The work on an existing set is a stub that logs "SME-STUB ..." and replies with a placeholder until the set primitives exist. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Permanent tests for the argument parsing and errors of the ten commands, the replies for missing keys and wrong types, the expire time limits, and COMMAND INFO, GETKEYS, DOCS, ACL categories and permissions. Scaffolding tests, marked SCAFFOLDING, check through the log that the stubs receive the parsed members, times and flags; they go away with the stubs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
setTypeInitIterator() now takes a mode. SET_ITER_RAW returns every member physically in the set (persistence, copy, conversion, digest); SET_ITER_SKIP_EXPIRED never returns a logically expired member, for everything that returns members to a client or a module (SMEMBERS, SSCAN, the multi-set commands, SORT, the module key scan, SRANDMEMBER and SPOP). Requiring the mode at every call site makes the classification explicit and is checked by the compiler. No set has an expiration yet, so behavior is unchanged and the mode is stored for the encodings to use later. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add the OBJ_ENCODING_LISTPACK_EX encoding for sets: a listpackEx wrapper (the same one hashes use) around a listpack of (member, ttl) pairs ordered by ttl, members without a ttl last, with the ops for lookup, add (with or without an expiration, replacing a logically expired member), removal, ttl get and set, minimum expire, bulk removal of expired members, iteration with the ttl, dup, free and conversion from a listpack or an intset. The ops table gets the optional expiration entries (NULL for the encodings that cannot hold expirations), the iterator reports the expiration of the member it returns and skips expired members in skip-expired mode, and setHasSubexpiry, setGetExpireMeta and setTypeGetMinExpire become real. Nothing creates this encoding yet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…oding Replace the stubs of the ten commands with the real work for sets that are (or can become) listpacks with member expirations: - SEXPIRE family: per member NX/XX/GT/LT, an expiration in the past deletes the member (reply 2, an explicit SREM is propagated), a member that is logically expired but not removed yet is treated as missing, the first expiration converts a listpack or intset to the expiration encoding. The command is propagated as SPEXPIREAT with the members that were set. - STTL family and SPERSIST: replies as the hash field expiration commands; nothing is deleted by the getters. - SADDEX: add or update members with an expiration or KEEPTTL, MNX/MXX as all-or-nothing conditions, an expiration in the past deletes the existing members and adds none; propagated with an absolute PXAT time. Keyspace events (sexpire, spersist, srem, sadd, and del when the set empties), keysizes and allocation size updates follow the hash commands. Sets that would need a hashtable to hold expirations get an error until that encoding exists. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Replace the scaffolding tests with behavior tests written as a matrix over the encodings: setting, reading and removing member expirations, the conditions, expirations in the past, expired-but-not-removed members, ordering, SADDEX options, intset conversion, keyspace notifications and the canonical propagation of the commands. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- SISMEMBER, SMISMEMBER: a member that is logically expired is not a member, and is removed (with an explicit SREM, a sexpired event and the counters, and the key if it was the last member), unless this node must not remove expired data (a replica, loading, paused expiration), where it only hides it. - SMEMBERS, SSCAN: skip the expired members without removing them. - SADD and SREM: an expired member is replaced by a new one, or removed and counted, as if it were not there. - SPOP and SRANDMEMBER: remove the expired members first and delete the key if none is left; SRANDMEMBER also never returns an expired member when the sweep cannot run, by sampling among the live members. - SPOP with a count keeps the expirations of the members that remain. - SMOVE moves the expiration with the member, overwriting the one at the destination, with the sadd/sexpire/spersist events. - The multi-set commands treat expired members as absent without removing them. The shared helpers setTypeIsMemberLazy(), setTypeExpire() and setTypeExpireIfNeeded() mirror the hash field ones, including their flags. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Tests for the lazy and sweeping behavior of every existing set command on logically expired members, SMOVE with expirations and its events, the replica illusion, the explicit SREM propagation and counters, and the allocation size accounting (the keysizes and allocation size assertions are enabled). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…hem actively Sets with member expirations are registered in db->subexpires with their earliest expiration, through setTypeUpdateSubexpiry(), called by the commands that can make it earlier or create the registration (SEXPIRE family, SPERSIST, SADDEX, SMOVE, SPOP with the move strategy, the sweep) and by COPY. The active expiry cycle now handles sets: it removes the expired members with an explicit SREM per member, the sexpired event and the counters, deletes the key if it empties, and registers the next time. Changes that can only make the earliest expiration later do not update the registration, as for hashes: the active cycle finds out when it visits the set. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…irations Active expiry (members, last member, events, propagation, many sets mixed with hashes, a cluster node), the registration following the earliest expiration, and RENAME, MOVE, COPY, DEL, UNLINK, overwrite, FLUSHDB, FLUSHALL, SWAPDB, key expirations, SADDEX, SMOVE and SPOP. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Hashtable sets can hold member expirations. The dict members are plain sds or SetEntry (a member with an expiration), a second dict type adds the metadata (an ExpireMeta to register the set in db->subexpires and a private ebuckets tree of the members that have an expiration), and the dict is changed to it in place on the first expiration. The two dict types now live in t_set_hashtable.c and share a destructor that handles both member forms. The hashtable ops implement the expiration ops, SSCAN skips expired members, and the common code now prepares any set for expirations: a listpack or intset that fits becomes a listpack with expirations, a bigger one becomes a hashtable, and a set with expirations grows to a hashtable keeping them (and its registration in subexpires). The temporary errors for sets that need a hashtable are gone. Active defrag skips sets with member expirations until its support is added. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…versions Add the hashtable to the encoding matrix so every behavior test runs on it, and add tests for big sets, members of every length and binary members, many expirations in random order with rehashing, growth from a listpack with expirations (the limit counts members) and by member length, SADDEX and first expirations on big sets and intsets, SMOVE into a full set, limits changed at runtime and COPY. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…wins Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…DIFFSTORE Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…types 34 and 35) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… with expirations Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… fork child Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ad the listpack with expirations Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ShooterIT
reviewed
Oct 27, 2026
yinon-bit
approved these changes
Oct 28, 2026
The big_hashtable case only reached a 1.30 allocator_frag_ratio on the CI runner, failing the strict 'more than 1.3' check of the test setup. Require 1.2, still well above the 1.07 that defrag must reach. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
There are 11 total unresolved issues (including 9 from previous reviews).
Reviewed by Cursor Bugbot for commit 7b43f3e. Configure here.
Merged
This was referenced Oct 29, 2026
1 of 3 tasks
PavelPashov
added a commit
to ioredis/commands
that referenced
this pull request
Oct 29, 2026
Add SADDEX, SEXPIRE, SEXPIREAT, SEXPIRETIME, SPERSIST, SPEXPIRE, SPEXPIREAT, SPEXPIRETIME, SPTTL and STTL from redis/redis#15938. Co-authored-by: Claude Opus 5.5 <[email protected]>
PavelPashov
added a commit
to PavelPashov/ioredis
that referenced
this pull request
Oct 29, 2026
Add typed support for SADDEX, SEXPIRE, SEXPIREAT, SEXPIRETIME, SPERSIST, SPEXPIRE, SPEXPIREAT, SPEXPIRETIME, SPTTL and STTL (Redis 8.12, redis/redis#15938). They mirror the hash field expiration commands and return the same reply shapes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PavelPashov
added a commit
to redis/ioredis
that referenced
this pull request
Nov 2, 2026
* ci: update Redis test matrix Replace the custom 8.10 image with the 8.10.0 release, add the unstable 8.12 image, and drop 8.4.0, which is neither an LTS line nor among the latest releases. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat: add set member expiration commands Add typed support for SADDEX, SEXPIRE, SEXPIREAT, SEXPIRETIME, SPERSIST, SPEXPIRE, SPEXPIREAT, SPEXPIRETIME, SPTTL and STTL (Redis 8.12, redis/redis#15938). They mirror the hash field expiration commands and return the same reply shapes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(deps): bump @ioredis/commands to 2.2.0 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
mgravell
added a commit
to seredis/StackExchange.Redis
that referenced
this pull request
Nov 9, 2026
The hash-field-TTL idea (7.4's HEXPIRE) brought to sets (redis/redis#15938, 8.12-rc2), mirroring the HashField* family: - SetAddAndSetExpiry (SADDEX): add members and/or (re)set their expiration in one atomic call; When.NotExists/Exists map to MNX/MXX, which are all-or-nothing across the batch, exactly as HSETEX's FNX/FXX; the bare form discards an existing TTL, KEEPTTL keeps it - SetMemberExpire (SEXPIRE/SPEXPIRE/SEXPIREAT/SPEXPIREAT by precision) -> ExpireResult[], per member - SetMemberGetTimeToLive (SPTTL) and SetMemberGetExpireDateTime (SPEXPIRETIME) -> long[] - SetMemberPersist (SPERSIST) -> PersistResult[] - KeyNotificationType.SExpired ('sexpired', side-effect block), so the 8.12 notification - including on the subkey channels, whose payload names the lapsed member - parses as a known type; GetSubKeys() already handles the payload Gated [Experimental] behind SER011/Experiments.Server_8_12 and RedisFeatures.v8_12_0 (8.11.241), both shared with #3261/#3315; the test docker image moves to client-libs-test:8.12-rc2 as in those PRs. Round-trip tests pin the exact wire bytes; the live tests (HashFieldTests mirror) pass against the 8.12-rc2 topology on both protocols. Plan document in notes/set-member-expiry/.
mgravell
added a commit
to seredis/StackExchange.Redis
that referenced
this pull request
Nov 9, 2026
…ST on IDatabase (#3340) * Initial support for Redis 8.12 set-member expiration The hash-field-TTL idea (7.4's HEXPIRE) brought to sets (redis/redis#15938, 8.12-rc2), mirroring the HashField* family: - SetAddAndSetExpiry (SADDEX): add members and/or (re)set their expiration in one atomic call; When.NotExists/Exists map to MNX/MXX, which are all-or-nothing across the batch, exactly as HSETEX's FNX/FXX; the bare form discards an existing TTL, KEEPTTL keeps it - SetMemberExpire (SEXPIRE/SPEXPIRE/SEXPIREAT/SPEXPIREAT by precision) -> ExpireResult[], per member - SetMemberGetTimeToLive (SPTTL) and SetMemberGetExpireDateTime (SPEXPIRETIME) -> long[] - SetMemberPersist (SPERSIST) -> PersistResult[] - KeyNotificationType.SExpired ('sexpired', side-effect block), so the 8.12 notification - including on the subkey channels, whose payload names the lapsed member - parses as a known type; GetSubKeys() already handles the payload Gated [Experimental] behind SER011/Experiments.Server_8_12 and RedisFeatures.v8_12_0 (8.11.241), both shared with #3261/#3315; the test docker image moves to client-libs-test:8.12-rc2 as in those PRs. Round-trip tests pin the exact wire bytes; the live tests (HashFieldTests mirror) pass against the 8.12-rc2 topology on both protocols. Plan document in notes/set-member-expiry/. * SADDEX rides SetAdd: two Expiration overloads replace the four-per-arity SetAddAndSetExpiry surface Review feedback (see the PR): Expiration already encodes EX/PX/EXAT/PXAT/KEEPTTL - exactly SADDEX's expiration block - so the TimeSpan?/DateTime/keepTtl splits collapse and the surface is SetAdd(key, value, Expiration, When, flags) and SetAdd(key, values, Expiration, When, flags), both bool (+async): 8 members become 4, with no new method name. A required Expiration keeps overload resolution away from the existing SetAdd members. - Expiration.Persist is rejected (SADDEX has no PERSIST; SetMemberPersist is the way to remove member expirations) - previously it would have been sent as a bogus token. - The overloads always send SADDEX: plain SADD is not an equivalent fallback for the no-expiry form, because bare SADDEX discards an existing member's TTL where SADD leaves existing members untouched; the XML docs call this out, and that the multi-value form reports only whether anything changed, not a count. - The SetMemberExpire/GetTimeToLive/GetExpireDateTime/Persist family is unchanged (ExpireWhen's GT/LT cannot ride Expiration, and it mirrors the HashField shape). - plan.md carries a revision note; SER011.md updated; all 50 SetMemberExpiry tests pass live against 8.12-rc2, 525 KeyPrefixed tests pass. * Each set-member-expiry test deletes its key up front: SADDEX's changed-anything reply and the MNX/NX conditions make residue from a previous run (or the other protocol) look like a failure
github-actions Bot
pushed a commit
to redis/ioredis
that referenced
this pull request
Nov 23, 2026
# [6.1.0](v6.0.0...v6.1.0) (2026-11-23) ### Bug Fixes * accept field arrays in hmget/hmgetBuffer types ([#2167](#2167)) ([c0cd66c](c0cd66c)) * align auto-pipeline callbacks for dynamic commands ([#2180](#2180)) ([7479cab](7479cab)) * apply the legacy reply shape to uppercase command names ([#2252](#2252)) ([8ecb423](8ecb423)) * clean up Sentinel failover subscriptions after quit ([#2198](#2198)) ([727edfa](727edfa)) * close the monitor connection when monitor() rejects ([#2247](#2247)) ([3cfe93f](3cfe93f)) * cluster stuck in close ([#2217](#2217)) ([a5fad1d](a5fad1d)) * **cluster:** bucket autopipelined MSET objects by their first key ([#2207](#2207)) ([b4e3237](b4e3237)) * **cluster:** do not reject pipeline commands for connecting nodes when offline queue is disabled ([#2277](#2277)) ([71516ca](71516ca)), closes [#2096](#2096) [Cluster#sendCommand](https://github.com/Cluster/issues/sendCommand) [#2276](#2276) * **cluster:** do not throw when auto-pipelining meets an uncached slot ([#2233](#2233)) ([e04bb49](e04bb49)) * **cluster:** don't fall back to a replica when no primary is left ([#2275](#2275)) ([c353e34](c353e34)) * **cluster:** emit sharded subscriber connect errors silently ([#2241](#2241)) ([00c9a22](00c9a22)) * **cluster:** end when quit() or disconnect() is called while reconnecting ([#2240](#2240)) ([8526785](8526785)) * **cluster:** hash autopipelined Buffer keys by their bytes ([#2208](#2208)) ([a8378bd](a8378bd)), closes [Command#getSlot](https://github.com/Command/issues/getSlot) * **cluster:** hash lone surrogates as the UTF-8 Node sends ([#2242](#2242)) ([cfa464d](cfa464d)) * **cluster:** keep forwarding sharded messages after reconnecting from end ([#2251](#2251)) ([326e987](326e987)) * **cluster:** map every slot when stringNumbers is enabled ([#2255](#2255)) ([8ce4115](8ce4115)) * **cluster:** match Buffer shard channels when unsubscribing ([#2203](#2203)) ([d997d01](d997d01)) * **cluster:** pass the retry delay to the reconnecting event ([#2291](#2291)) ([ed50383](ed50383)) * **cluster:** resend only the redirected command in a pipeline ([#2214](#2214)) ([46b3191](46b3191)), closes [#2075](#2075) [Pipeline#exec](https://github.com/Pipeline/issues/exec) [Cluster#sendCommand](https://github.com/Cluster/issues/sendCommand) [Pipeline#exec](https://github.com/Pipeline/issues/exec) [Cluster#sendCommand](https://github.com/Cluster/issues/sendCommand) [Pipeline#exec](https://github.com/Pipeline/issues/exec) * **cluster:** stay ended when nodes removed by disconnect() end late ([#2237](#2237)) ([61896e5](61896e5)), closes [#2217](#2217) * **cluster:** stop refreshing slots when disconnect() is called during a refresh ([#2249](#2249)) ([80501ed](80501ed)) * **cluster:** support zero-argument sunsubscribe with sharded subscribers ([#2137](#2137)) ([13ff050](13ff050)), closes [#2133](#2133) * **cluster:** vendor cluster-key-slot to fix empty hash tag slot bug ([#2172](#2172)) ([b479b76](b479b76)) * correct Sentinel retry ordering after node connection failures ([#2246](#2246)) ([a10e0fa](a10e0fa)) * decode integer replies up to MAX_SAFE_INTEGER exactly ([#2164](#2164)) ([28940b5](28940b5)) * decode RESP3 attribute replies instead of failing the connection ([#2213](#2213)) ([6a8cb3e](6a8cb3e)), closes [#decodeNestedType](https://github.com/redis/ioredis/issues/decodeNestedType) [#decodeMapAsObject](https://github.com/redis/ioredis/issues/decodeMapAsObject) [#decodeMapKey](https://github.com/redis/ioredis/issues/decodeMapKey) * decode RESP3 doubles with Number ([#2150](#2150)) ([6fb5a10](6fb5a10)) * end when quit() or disconnect() is called while reconnecting ([#2245](#2245)) ([81bc16a](81bc16a)) * handle rejection from the db-restoring select on reconnectOnError ([#2229](#2229)) ([1b744ca](1b744ca)) * handle rejections from auto-resubscribe and select on reconnect ([#2187](#2187)) ([de2fbdf](de2fbdf)) * inherit connectTimeout for cluster subscribers ([#2220](#2220)) ([db57c2d](db57c2d)) * keep String.prototype in fast mode after defining VerbatimString ([#2206](#2206)) ([90e1261](90e1261)) * keep subscriber mode while other channel kinds remain subscribed ([#2196](#2196)) ([eb97beb](eb97beb)) * keep the exec error out of its own previousErrors ([#2218](#2218)) ([2c602cf](2c602cf)) * keep the selected db for commands queued while reconnecting ([#2235](#2235)) ([9f90154](9f90154)) * preserve empty keys and match patterns in scan streams ([#2199](#2199)) ([b169c3a](b169c3a)) * redact credentials from the command attached to errors ([#2231](#2231)) ([a26f8de](a26f8de)), closes [#1713](#1713) * reject unfulfilled commands dropped on reconnect ([#2194](#2194)) ([d95d05a](d95d05a)), closes [#2193](#2193) * reset retry attempts when connect() is called after giving up ([#2204](#2204)) ([b597303](b597303)), closes [#1463](#1463) * reset the manual close state when connect() is called after end ([#2250](#2250)) ([7713c4b](7713c4b)) * resolve argument-less (p)unsubscribe once its own kind is empty ([#2238](#2238)) ([280812b](280812b)) * restore the db selected by a non-lowercase SELECT after reconnecting ([#2248](#2248)) ([400b774](400b774)) * **sentinel:** handle errors on failover detector connections ([#2257](#2257)) ([09bcda5](09bcda5)) * **sentinel:** retry unreachable sentinels in a loop instead of recursing ([#2270](#2270)) ([6bee8d2](6bee8d2)) * **types:** accept documented TLS profile options ([#2195](#2195)) ([56a7fb8](56a7fb8)), closes [#1626](#1626) * **types:** add event overloads to Cluster interface ([#2201](#2201)) ([3996eaf](3996eaf)), closes [#2191](#2191) * **types:** add smessage and smessageBuffer event overloads ([#2191](#2191)) ([ee48f4c](ee48f4c)), closes [#2190](#2190) * **types:** allow number for zrange stop argument ([#2163](#2163)) ([932f4c2](932f4c2)) ### Features * add BITRANGEINTARRAY command ([#2279](#2279)) ([b141399](b141399)) * add set member expiration commands ([#2261](#2261)) ([5efba6b](5efba6b)), closes [redis/redis#15938](redis/redis#15938) * bless commands ([#2209](#2209)) ([9181ee0](9181ee0)) * **cluster:** allow configuring node role for Pub/Sub subscriber ([#2176](#2176)) ([6b9130c](6b9130c)) * sharded subscriber health check ([#2268](#2268)) ([1b25ffb](1b25ffb)) * smart client handoffs ([#2165](#2165)) ([d8ae3cb](d8ae3cb)) * sorted set move commands ([#2288](#2288)) ([2f4f09d](2f4f09d))
mgravell
added a commit
to seredis/StackExchange.Redis
that referenced
this pull request
Nov 23, 2026
…011) (#3343) * Redis 8.12 BITRANGEINTARRAY (bit enumeration): IDatabase.StringBitPositions (#3315) * Plan: StringBitPositions (BITRANGEINTARRAY, Redis 8.12) * Plan: record the behaviour observed against a local unstable build * Redis 8.12 BITRANGEINTARRAY: IDatabase.StringBitPositions Enumerates the set (or, with bit: false, the clear) bit positions in a byte or bit range of a string or native bitmap, ascending, with an optional LIMIT; the sibling of StringBitPosition (BITPOS). Reuses ResultProcessor.Int64Array; the argument tail fits Message.Create, with the default BYTE omitted as BITCOUNT/BITPOS do. Negative limit throws client-side. Gated [Experimental(Experiments.Server_8_12)] (SER011), with RedisFeatures.v8_12_0 and RedisFeatures.StringBitPositions, matching the BLESS branch so the two merge textually. Tests: exact wire bytes for every option combination (BitPositionsRoundTrip), and live tests in BitTests gated on v8_12_0, observed green against a local build of unstable (6a5fee67) on RESP2 and RESP3. Removes the BITRANGEINTARRAY row from the command coverage ledger. * 8.12 RC2: pin the real pre-release version and run CI against the RC2 image - RedisFeatures.v8_12_0 is now 8.11.241, which is what 8.12 RC2 reports (the earlier 8.12.0 placeholder made the gated tests skip on RC2) - the test topology image defaults to redislabs/client-libs-test:8.12-rc2 - the cluster configs opt out of the new cluster-bus-port-protected-mode check, which otherwise refuses to start a plaintext cluster node on RC2 Validated locally against the RC2 topology: StringBitPositions live tests and BitPositionsRoundTrip all pass, and the cluster forms cleanly. * SortedSetScanLarge: count distinct members, tolerating ZSCAN duplicates The 8.12 btree zset encoding can return duplicate members even for an unmodified key (redis/redis#16158; the SCAN contract allows it), so the test now asserts the distinct member count instead of the raw count. All 8 cases pass against the RC2 topology. * Set-member expiration (Redis 8.12): SADDEX / SEXPIRE / SPTTL / SPERSIST on IDatabase (#3340) * Initial support for Redis 8.12 set-member expiration The hash-field-TTL idea (7.4's HEXPIRE) brought to sets (redis/redis#15938, 8.12-rc2), mirroring the HashField* family: - SetAddAndSetExpiry (SADDEX): add members and/or (re)set their expiration in one atomic call; When.NotExists/Exists map to MNX/MXX, which are all-or-nothing across the batch, exactly as HSETEX's FNX/FXX; the bare form discards an existing TTL, KEEPTTL keeps it - SetMemberExpire (SEXPIRE/SPEXPIRE/SEXPIREAT/SPEXPIREAT by precision) -> ExpireResult[], per member - SetMemberGetTimeToLive (SPTTL) and SetMemberGetExpireDateTime (SPEXPIRETIME) -> long[] - SetMemberPersist (SPERSIST) -> PersistResult[] - KeyNotificationType.SExpired ('sexpired', side-effect block), so the 8.12 notification - including on the subkey channels, whose payload names the lapsed member - parses as a known type; GetSubKeys() already handles the payload Gated [Experimental] behind SER011/Experiments.Server_8_12 and RedisFeatures.v8_12_0 (8.11.241), both shared with #3261/#3315; the test docker image moves to client-libs-test:8.12-rc2 as in those PRs. Round-trip tests pin the exact wire bytes; the live tests (HashFieldTests mirror) pass against the 8.12-rc2 topology on both protocols. Plan document in notes/set-member-expiry/. * SADDEX rides SetAdd: two Expiration overloads replace the four-per-arity SetAddAndSetExpiry surface Review feedback (see the PR): Expiration already encodes EX/PX/EXAT/PXAT/KEEPTTL - exactly SADDEX's expiration block - so the TimeSpan?/DateTime/keepTtl splits collapse and the surface is SetAdd(key, value, Expiration, When, flags) and SetAdd(key, values, Expiration, When, flags), both bool (+async): 8 members become 4, with no new method name. A required Expiration keeps overload resolution away from the existing SetAdd members. - Expiration.Persist is rejected (SADDEX has no PERSIST; SetMemberPersist is the way to remove member expirations) - previously it would have been sent as a bogus token. - The overloads always send SADDEX: plain SADD is not an equivalent fallback for the no-expiry form, because bare SADDEX discards an existing member's TTL where SADD leaves existing members untouched; the XML docs call this out, and that the multi-value form reports only whether anything changed, not a count. - The SetMemberExpire/GetTimeToLive/GetExpireDateTime/Persist family is unchanged (ExpireWhen's GT/LT cannot ride Expiration, and it mirrors the HashField shape). - plan.md carries a revision note; SER011.md updated; all 50 SetMemberExpiry tests pass live against 8.12-rc2, 525 KeyPrefixed tests pass. * Each set-member-expiry test deletes its key up front: SADDEX's changed-anything reply and the MNX/NX conditions make residue from a previous run (or the other protocol) look like a failure * Redis 8.12 BLESS (eviction protection) support (#3261) Adds KeyBless/KeyUnbless/KeyBlessFlags (+async) on IDatabase and IServer.BlessedKeys (+async) over BLESS SCAN, with the BlessFlags enum, gated behind SER011 (Server_8_12). SET/CLEAR are raised to primary-only; GET stays replica-eligible. Adds bless/unbless keyspace notification types. * CommandCoverage: the BLESS rows retire with #3261 (the ledger lists only unexposed commands) * Redis 8.12 atomic sorted-set moves: ZMOVE / ZMOVEMEMBER on IDatabase (#3351) redis/redis#16135 (8.12-rc3) adds ZMOVE, BZMOVE and ZMOVEMEMBER: - SortedSetMove (ZMOVE MIN|MAX [COUNT]) - from the low or high end - SortedSetMoveByScore (ZMOVE BYSCORE min max [COUNT]) - a score range - SortedSetMoveMembers (ZMOVEMEMBER [NX|XX] MEMBERS n ...) - named members, with When as the per-member condition on the destination Each returns SortedSetEntry[]?, null when nothing moved (the server's null reply is never folded into an empty array). COUNT is sent if and only if the caller gives one: for BYSCORE, no COUNT means the whole range, so the SortedSetPop habit of eliding COUNT 1 is not copied. The reply is nested [member, score] pairs in RESP2 as well as RESP3, unlike ZPOPMIN, so SortedSetWithScores does not fit; NullableSortedSetEntryArray is a strict nested-pair processor. BZMOVE is not exposed (blocking; policy row in CommandCoverage.md). Gated [Experimental] behind SER011 and the new RedisFeatures.v8_12_0_rc3 (8.11.242: rc2 does not have the commands); the test docker image moves to client-libs-test:8.12-rc3. * SLOWLOG GET: surface the 8.12 estimated-CPU-time field as CommandTrace.CpuTime The 8th entry field (redis/redis#15907, 8.12 RC3) is the duration minus the provable off-CPU time, distinguishing a command that ran slowly from one starved of CPU. Parsed positionally past the client address/name and argument count, so every historical entry length still parses: null when the server did not send the field, zero (per the server) when it was not measured. Gated SER011 with the rest of the 8.12 surface. * Redis 8.12 GA: test against client-libs-test:8.12.0; SER011 stays while the library API settles 8.12.0 went GA on 2026-11-22. The docker test image moves from 8.12-rc3 to 8.12.0, and docs/exp/SER011.md now says the server is generally available while the library API remains experimental.
renovate Bot
added a commit
to NemesisRE/famvacay
that referenced
this pull request
Nov 25, 2026
This PR contains the following updates: | Package | Type | Update | Change | Pending | OpenSSF | |---|---|---|---|---|---| | [ioredis](https://redirect.github.com/redis/ioredis) | dependencies | minor | [`6.0.0` → `6.1.0`](https://renovatebot.com/diffs/npm/ioredis/6.0.0/6.1.0) | | [](https://securityscorecards.dev/viewer/?uri=github.com/redis/ioredis) | | [lucide-react](https://lucide.dev) ([source](https://redirect.github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react)) | dependencies | minor | [`1.77.0` → `1.78.0`](https://renovatebot.com/diffs/npm/lucide-react/1.77.0/1.78.0) | `1.79.0` | [](https://securityscorecards.dev/viewer/?uri=github.com/lucide-icons/lucide) | --- ### Release Notes <details> <summary>redis/ioredis (ioredis)</summary> ### [`v6.1.0`](https://redirect.github.com/redis/ioredis/blob/HEAD/CHANGELOG.md#610-2026-11-23) [Compare Source](https://redirect.github.com/redis/ioredis/compare/v6.0.0...v6.1.0) ##### Bug Fixes - accept field arrays in hmget/hmgetBuffer types ([#​2167](https://redirect.github.com/redis/ioredis/issues/2167)) ([c0cd66c](https://redirect.github.com/redis/ioredis/commit/c0cd66cad8bc3d6fb02e2021f32ae2a88506ee97)) - align auto-pipeline callbacks for dynamic commands ([#​2180](https://redirect.github.com/redis/ioredis/issues/2180)) ([7479cab](https://redirect.github.com/redis/ioredis/commit/7479cabf7538d3d1db25ddb8a81041e74d69627e)) - apply the legacy reply shape to uppercase command names ([#​2252](https://redirect.github.com/redis/ioredis/issues/2252)) ([8ecb423](https://redirect.github.com/redis/ioredis/commit/8ecb42367b4e495f040cd4c4ccaa4ee2ce3394fc)) - clean up Sentinel failover subscriptions after quit ([#​2198](https://redirect.github.com/redis/ioredis/issues/2198)) ([727edfa](https://redirect.github.com/redis/ioredis/commit/727edfa6c05b18d25ad74cfc89335911475e48ae)) - close the monitor connection when monitor() rejects ([#​2247](https://redirect.github.com/redis/ioredis/issues/2247)) ([3cfe93f](https://redirect.github.com/redis/ioredis/commit/3cfe93f40c0820fbaa01198514edde3a0b76cd94)) - cluster stuck in close ([#​2217](https://redirect.github.com/redis/ioredis/issues/2217)) ([a5fad1d](https://redirect.github.com/redis/ioredis/commit/a5fad1db7bc8231c09631a99763f5c99b88d7ad9)) - **cluster:** bucket autopipelined MSET objects by their first key ([#​2207](https://redirect.github.com/redis/ioredis/issues/2207)) ([b4e3237](https://redirect.github.com/redis/ioredis/commit/b4e3237d68f8da497dd08d0a227b4b8d8ecd633b)) - **cluster:** do not reject pipeline commands for connecting nodes when offline queue is disabled ([#​2277](https://redirect.github.com/redis/ioredis/issues/2277)) ([71516ca](https://redirect.github.com/redis/ioredis/commit/71516ca3e9c8b93e01092b8915f45cfa8292f548)), closes [#​2096](https://redirect.github.com/redis/ioredis/issues/2096) [Cluster#sendCommand](https://redirect.github.com/Cluster/issues/sendCommand) [#​2276](https://redirect.github.com/redis/ioredis/issues/2276) - **cluster:** do not throw when auto-pipelining meets an uncached slot ([#​2233](https://redirect.github.com/redis/ioredis/issues/2233)) ([e04bb49](https://redirect.github.com/redis/ioredis/commit/e04bb498383a8aef4e1bd086b0c6060771a7f12b)) - **cluster:** don't fall back to a replica when no primary is left ([#​2275](https://redirect.github.com/redis/ioredis/issues/2275)) ([c353e34](https://redirect.github.com/redis/ioredis/commit/c353e34578c2151a167fd0864fd3a1a8dd47051a)) - **cluster:** emit sharded subscriber connect errors silently ([#​2241](https://redirect.github.com/redis/ioredis/issues/2241)) ([00c9a22](https://redirect.github.com/redis/ioredis/commit/00c9a22fb96d4aa5fa3b15e6dfe36505c13fc11d)) - **cluster:** end when quit() or disconnect() is called while reconnecting ([#​2240](https://redirect.github.com/redis/ioredis/issues/2240)) ([8526785](https://redirect.github.com/redis/ioredis/commit/852678553c805a1733ceb92d193682b8cb4212f9)) - **cluster:** hash autopipelined Buffer keys by their bytes ([#​2208](https://redirect.github.com/redis/ioredis/issues/2208)) ([a8378bd](https://redirect.github.com/redis/ioredis/commit/a8378bd9a6d44823b2c1813f258a179313d4a23f)), closes [Command#getSlot](https://redirect.github.com/Command/issues/getSlot) - **cluster:** hash lone surrogates as the UTF-8 Node sends ([#​2242](https://redirect.github.com/redis/ioredis/issues/2242)) ([cfa464d](https://redirect.github.com/redis/ioredis/commit/cfa464d830ed73665c0f4a6afcd3e215cb3f0cc3)) - **cluster:** keep forwarding sharded messages after reconnecting from end ([#​2251](https://redirect.github.com/redis/ioredis/issues/2251)) ([326e987](https://redirect.github.com/redis/ioredis/commit/326e98786577b1374bb076f6a6fb00c1c66bd5f6)) - **cluster:** map every slot when stringNumbers is enabled ([#​2255](https://redirect.github.com/redis/ioredis/issues/2255)) ([8ce4115](https://redirect.github.com/redis/ioredis/commit/8ce4115c3564d7863ee975f15ef773e640a2bd5b)) - **cluster:** match Buffer shard channels when unsubscribing ([#​2203](https://redirect.github.com/redis/ioredis/issues/2203)) ([d997d01](https://redirect.github.com/redis/ioredis/commit/d997d0141b8c77c6275cb5d1be86b8cfd0e87dad)) - **cluster:** pass the retry delay to the reconnecting event ([#​2291](https://redirect.github.com/redis/ioredis/issues/2291)) ([ed50383](https://redirect.github.com/redis/ioredis/commit/ed5038342271a7d6397299ccd3886afce3afef19)) - **cluster:** resend only the redirected command in a pipeline ([#​2214](https://redirect.github.com/redis/ioredis/issues/2214)) ([46b3191](https://redirect.github.com/redis/ioredis/commit/46b31917242dc20998eccc39183e3f54b76552e8)), closes [#​2075](https://redirect.github.com/redis/ioredis/issues/2075) [Pipeline#exec](https://redirect.github.com/Pipeline/issues/exec) [Cluster#sendCommand](https://redirect.github.com/Cluster/issues/sendCommand) [Pipeline#exec](https://redirect.github.com/Pipeline/issues/exec) [Cluster#sendCommand](https://redirect.github.com/Cluster/issues/sendCommand) [Pipeline#exec](https://redirect.github.com/Pipeline/issues/exec) - **cluster:** stay ended when nodes removed by disconnect() end late ([#​2237](https://redirect.github.com/redis/ioredis/issues/2237)) ([61896e5](https://redirect.github.com/redis/ioredis/commit/61896e52224cb3dd53b8e8a6c439bfe960b19684)), closes [#​2217](https://redirect.github.com/redis/ioredis/issues/2217) - **cluster:** stop refreshing slots when disconnect() is called during a refresh ([#​2249](https://redirect.github.com/redis/ioredis/issues/2249)) ([80501ed](https://redirect.github.com/redis/ioredis/commit/80501edc2f6d34869b6c366cb20bc72604885c6c)) - **cluster:** support zero-argument sunsubscribe with sharded subscribers ([#​2137](https://redirect.github.com/redis/ioredis/issues/2137)) ([13ff050](https://redirect.github.com/redis/ioredis/commit/13ff050989c139843d3544a4ca556f2740a5619d)), closes [#​2133](https://redirect.github.com/redis/ioredis/issues/2133) - **cluster:** vendor cluster-key-slot to fix empty hash tag slot bug ([#​2172](https://redirect.github.com/redis/ioredis/issues/2172)) ([b479b76](https://redirect.github.com/redis/ioredis/commit/b479b7627e51baec5f9a58a8d3d7640d97bcf3e5)) - correct Sentinel retry ordering after node connection failures ([#​2246](https://redirect.github.com/redis/ioredis/issues/2246)) ([a10e0fa](https://redirect.github.com/redis/ioredis/commit/a10e0faeab10ccad1a7b74188ab1476208e6c437)) - decode integer replies up to MAX_SAFE_INTEGER exactly ([#​2164](https://redirect.github.com/redis/ioredis/issues/2164)) ([28940b5](https://redirect.github.com/redis/ioredis/commit/28940b5e29f38ce4252f1f30dc3cdc38e32f540c)) - decode RESP3 attribute replies instead of failing the connection ([#​2213](https://redirect.github.com/redis/ioredis/issues/2213)) ([6a8cb3e](https://redirect.github.com/redis/ioredis/commit/6a8cb3e87424b07814322cf79de6873563fb0592)), closes [#decodeNestedType](https://redirect.github.com/redis/ioredis/issues/decodeNestedType) [#decodeMapAsObject](https://redirect.github.com/redis/ioredis/issues/decodeMapAsObject) [#decodeMapKey](https://redirect.github.com/redis/ioredis/issues/decodeMapKey) - decode RESP3 doubles with Number ([#​2150](https://redirect.github.com/redis/ioredis/issues/2150)) ([6fb5a10](https://redirect.github.com/redis/ioredis/commit/6fb5a10bb8a3c2d61a7c8484e6ffec331cca2724)) - end when quit() or disconnect() is called while reconnecting ([#​2245](https://redirect.github.com/redis/ioredis/issues/2245)) ([81bc16a](https://redirect.github.com/redis/ioredis/commit/81bc16a2801313b9990a0784094a552dfe1615c5)) - handle rejection from the db-restoring select on reconnectOnError ([#​2229](https://redirect.github.com/redis/ioredis/issues/2229)) ([1b744ca](https://redirect.github.com/redis/ioredis/commit/1b744ca441c10122d6565e4a6e96b6007de4be0b)) - handle rejections from auto-resubscribe and select on reconnect ([#​2187](https://redirect.github.com/redis/ioredis/issues/2187)) ([de2fbdf](https://redirect.github.com/redis/ioredis/commit/de2fbdf219346e948a54319d68022861615fb540)) - inherit connectTimeout for cluster subscribers ([#​2220](https://redirect.github.com/redis/ioredis/issues/2220)) ([db57c2d](https://redirect.github.com/redis/ioredis/commit/db57c2d9d0b6f089bd95938e8483459573272e64)) - keep String.prototype in fast mode after defining VerbatimString ([#​2206](https://redirect.github.com/redis/ioredis/issues/2206)) ([90e1261](https://redirect.github.com/redis/ioredis/commit/90e1261ce71f4e77ad00f54690eda54123c34bc6)) - keep subscriber mode while other channel kinds remain subscribed ([#​2196](https://redirect.github.com/redis/ioredis/issues/2196)) ([eb97beb](https://redirect.github.com/redis/ioredis/commit/eb97bebf60946303d5f82b01d293888e7339aff0)) - keep the exec error out of its own previousErrors ([#​2218](https://redirect.github.com/redis/ioredis/issues/2218)) ([2c602cf](https://redirect.github.com/redis/ioredis/commit/2c602cf32a0a261d0f7c041d27674ec0ff2de56d)) - keep the selected db for commands queued while reconnecting ([#​2235](https://redirect.github.com/redis/ioredis/issues/2235)) ([9f90154](https://redirect.github.com/redis/ioredis/commit/9f901544db31e1fb5947be9ab55b63882eefd1b8)) - preserve empty keys and match patterns in scan streams ([#​2199](https://redirect.github.com/redis/ioredis/issues/2199)) ([b169c3a](https://redirect.github.com/redis/ioredis/commit/b169c3af29887aec8cf1a879dc9c808192e3d3d9)) - redact credentials from the command attached to errors ([#​2231](https://redirect.github.com/redis/ioredis/issues/2231)) ([a26f8de](https://redirect.github.com/redis/ioredis/commit/a26f8debd7fb83c35a19d0f3d92726b6706d2186)), closes [#​1713](https://redirect.github.com/redis/ioredis/issues/1713) - reject unfulfilled commands dropped on reconnect ([#​2194](https://redirect.github.com/redis/ioredis/issues/2194)) ([d95d05a](https://redirect.github.com/redis/ioredis/commit/d95d05a964be3687b01381224753f82c23427177)), closes [#​2193](https://redirect.github.com/redis/ioredis/issues/2193) - reset retry attempts when connect() is called after giving up ([#​2204](https://redirect.github.com/redis/ioredis/issues/2204)) ([b597303](https://redirect.github.com/redis/ioredis/commit/b59730310716d7e4b3330ee42c140f7acd409444)), closes [#​1463](https://redirect.github.com/redis/ioredis/issues/1463) - reset the manual close state when connect() is called after end ([#​2250](https://redirect.github.com/redis/ioredis/issues/2250)) ([7713c4b](https://redirect.github.com/redis/ioredis/commit/7713c4bbc9440f62dde0c7e846dfbc56f4009cfe)) - resolve argument-less (p)unsubscribe once its own kind is empty ([#​2238](https://redirect.github.com/redis/ioredis/issues/2238)) ([280812b](https://redirect.github.com/redis/ioredis/commit/280812bcfd042f2a6eac3bc983906db5b79daff1)) - restore the db selected by a non-lowercase SELECT after reconnecting ([#​2248](https://redirect.github.com/redis/ioredis/issues/2248)) ([400b774](https://redirect.github.com/redis/ioredis/commit/400b7746eb90757273abda42477c5a9ed712a0d6)) - **sentinel:** handle errors on failover detector connections ([#​2257](https://redirect.github.com/redis/ioredis/issues/2257)) ([09bcda5](https://redirect.github.com/redis/ioredis/commit/09bcda54026145b3f347494d4530670b6c37ab67)) - **sentinel:** retry unreachable sentinels in a loop instead of recursing ([#​2270](https://redirect.github.com/redis/ioredis/issues/2270)) ([6bee8d2](https://redirect.github.com/redis/ioredis/commit/6bee8d2178b2bf66db840a9a1ccf039a0907715d)) - **types:** accept documented TLS profile options ([#​2195](https://redirect.github.com/redis/ioredis/issues/2195)) ([56a7fb8](https://redirect.github.com/redis/ioredis/commit/56a7fb8ad31b651917f9bb0c8e5fa3bae65bb281)), closes [#​1626](https://redirect.github.com/redis/ioredis/issues/1626) - **types:** add event overloads to Cluster interface ([#​2201](https://redirect.github.com/redis/ioredis/issues/2201)) ([3996eaf](https://redirect.github.com/redis/ioredis/commit/3996eaf2e849b9c472eb01729c7cef9f7f1e657f)), closes [#​2191](https://redirect.github.com/redis/ioredis/issues/2191) - **types:** add smessage and smessageBuffer event overloads ([#​2191](https://redirect.github.com/redis/ioredis/issues/2191)) ([ee48f4c](https://redirect.github.com/redis/ioredis/commit/ee48f4c25138f6716de07c4da33e96590f7f01b1)), closes [#​2190](https://redirect.github.com/redis/ioredis/issues/2190) - **types:** allow number for zrange stop argument ([#​2163](https://redirect.github.com/redis/ioredis/issues/2163)) ([932f4c2](https://redirect.github.com/redis/ioredis/commit/932f4c2903639d5b7782fe35004918d9c1e5e084)) ##### Features - add BITRANGEINTARRAY command ([#​2279](https://redirect.github.com/redis/ioredis/issues/2279)) ([b141399](https://redirect.github.com/redis/ioredis/commit/b1413993d6b51531b27fea72f336fdcb806b64d7)) - add set member expiration commands ([#​2261](https://redirect.github.com/redis/ioredis/issues/2261)) ([5efba6b](https://redirect.github.com/redis/ioredis/commit/5efba6b7b5609470937f598e327fa5ece87f8f43)), closes [redis/redis#15938](https://redirect.github.com/redis/redis/issues/15938) - bless commands ([#​2209](https://redirect.github.com/redis/ioredis/issues/2209)) ([9181ee0](https://redirect.github.com/redis/ioredis/commit/9181ee065f5214df5e5163353ab4bf44ee3bd327)) - **cluster:** allow configuring node role for Pub/Sub subscriber ([#​2176](https://redirect.github.com/redis/ioredis/issues/2176)) ([6b9130c](https://redirect.github.com/redis/ioredis/commit/6b9130c4f9a9134a5109c3f064d9dda803047b6a)) - sharded subscriber health check ([#​2268](https://redirect.github.com/redis/ioredis/issues/2268)) ([1b25ffb](https://redirect.github.com/redis/ioredis/commit/1b25ffb6d13f75cb706c1b6815adcac58aa5132b)) - smart client handoffs ([#​2165](https://redirect.github.com/redis/ioredis/issues/2165)) ([d8ae3cb](https://redirect.github.com/redis/ioredis/commit/d8ae3cb24c534e77b2c2df2f542cbf4789d758fe)) - sorted set move commands ([#​2288](https://redirect.github.com/redis/ioredis/issues/2288)) ([2f4f09d](https://redirect.github.com/redis/ioredis/commit/2f4f09d8a1e9a86b58b55790b344e893e3a81792)) </details> <details> <summary>lucide-icons/lucide (lucide-react)</summary> ### [`v1.78.0`](https://redirect.github.com/lucide-icons/lucide/releases/tag/1.78.0): Version 1.78.0 [Compare Source](https://redirect.github.com/lucide-icons/lucide/compare/1.77.0...1.78.0) #### What's Changed - docs(lucide-static): link to the packages page instead of listing packages by [@​farisbasha](https://redirect.github.com/farisbasha) in [#​5253](https://redirect.github.com/lucide-icons/lucide/pull/5253) - fix(packages): allow string values for `size` and `strokeWidth` in global icon config by [@​kenkunz](https://redirect.github.com/kenkunz) in [#​4870](https://redirect.github.com/lucide-icons/lucide/pull/4870) - feat(icons): added `circle-speed-lines` icon by [@​ericfennis](https://redirect.github.com/ericfennis) in [#​5204](https://redirect.github.com/lucide-icons/lucide/pull/5204) - feat(icons): added `package-arrow-bend-up-left` icon by [@​thanakritju](https://redirect.github.com/thanakritju) in [#​4420](https://redirect.github.com/lucide-icons/lucide/pull/4420) - feat(icons): added `hole` icon by [@​KesleyDavid](https://redirect.github.com/KesleyDavid) in [#​4686](https://redirect.github.com/lucide-icons/lucide/pull/4686) - feat(icons): added `graph-path` icon by [@​jwlinqx](https://redirect.github.com/jwlinqx) in [#​4493](https://redirect.github.com/lucide-icons/lucide/pull/4493) #### New Contributors - [@​farisbasha](https://redirect.github.com/farisbasha) made their first contribution in [#​5253](https://redirect.github.com/lucide-icons/lucide/pull/5253) - [@​kenkunz](https://redirect.github.com/kenkunz) made their first contribution in [#​4870](https://redirect.github.com/lucide-icons/lucide/pull/4870) - [@​thanakritju](https://redirect.github.com/thanakritju) made their first contribution in [#​4420](https://redirect.github.com/lucide-icons/lucide/pull/4420) **Full Changelog**: <lucide-icons/lucide@1.77.0...1.78.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone UTC) - Branch creation - "before 6am" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/NemesisRE/famvacay). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuMyIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJkZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Hash fields can expire individually (HFE), but set members cannot. Use cases such as a set of active sessions, rate-limit or deduplication windows, or short-lived tags currently need a companion sorted set plus application-side cleanup, or one key per member. This PR adds per-member expiration to sets, with an API that mirrors the hash field expiration commands, so that a set can hold members that expire on their own without extra bookkeeping.
Implementation overview
Re-using the HFE machinery. A set with member expirations is registered in
db->subexpires, the same per-database ebuckets that already tracks hashes with field expirations, keyed by the earliest member expiration. The registration hooks (key add, delete, overwrite, rename, move, RDB load, keymeta) and the active expiration cycle now dispatch on the object type (hash or set) instead of assuming a hash. Active expiration removes expired members in the same cron cycle that expires hash fields. The expiration time parsing and validation are shared with the hash commands.Lazy expiration. A member whose time has passed is treated as missing by the existing set commands (for example
SISMEMBER,SMISMEMBER,SMEMBERS,SSCAN,SORTand the module scan API), even before it is reclaimed.SISMEMBER,SMISMEMBER,SADD,SADDEX,SPOP,SRANDMEMBERand the*STOREsources first remove the expired members they find, with an explicitSREMeach in the replication stream;SPOPandSRANDMEMBERwith a count then iterate raw, asHRANDFIELDdoes.SCARDis the exception: to avoid the cost of checking expirations, it may count expired members that were not removed yet. Reads on a replica report expired members as missing but never delete them; deletion is always driven by the master and propagated asSREM. The master decides which members are expired: while loading, and for commands received from the master (including the AOF), a member is never expired by the local clock, so replication lag or clock skew cannot make a replica or an AOF replay diverge.SEXPIRE-family commands,SPERSISTandSADDEXare applied as they come, andSEXPIRE/SPERSISTpropagate only the members they actually changed. The iterator API now makes every caller choose between raw iteration and skipping expired members.Encodings. Every set can hold member expirations; a set that cannot as it is converts on its first expiration, and converts to a bigger encoding, keeping its expirations, when it grows past the listpack limits.
OBJ_ENCODING_LISTPACK_EX): a listpack of (member, ttl) pairs ordered by ttl, so the next member to expire is always first and the expired members are always a prefix. Modelled on the hash listpackex.ExpireMetaused to register the set insubexpires, and whose keys can beSetEntryobjects (below). The members' expiration times are kept in an ebuckets tree owned by the set.SetEntry(set_entry.c/.h): a hashtable set member that is the member sds itself, with an optionalExpireMetaplaced in front of the allocation. A member without an expiration costs nothing extra; one with an expiration is reallocated when the expiration is set or removed. This is the set counterpart of the hashEntry.Set encoding dispatch.
t_set.cnow dispatches through a per-encoding ops table (t_set_encoding.h: intset, listpack, listpackex, hashtable) instead ofif/elsechains on the encoding, which is what lets the two new encodings plug in cleanly. The*STOREvariants (SUNIONSTORE,SINTERSTORE,SDIFFSTORE) keep member expirations; when a member appears in several sets, a source without an expiration is ignored, and if more than one source has one,SINTERSTOREgives the nearest andSUNIONSTOREthe farthest.Persistence and replication.
RDB_TYPE_SET_LISTPACK_EX(34) andRDB_TYPE_SET_METADATA(35);RDB_VERSIONgoes to 17.RDB_TYPE_GCRAmoves from 34 to 36 to make room (it has not been released enabled).DUMP/RESTORE, full sync andredis-check-rdbhandle the new types. AOF rewrite emitsSADDEXfor members that have an expiration.PXAT/SPEXPIREAT), and a command that modifies nothing is not propagated and fires no events.DEBUG DIGESTcovers the member expirations.Other places that needed to know. Active defrag (including the
subexpirespointers), memory/keysizes accounting, the fork-child memory dismiss, the module scan API (expired members are skipped unless the key is opened withACCESS_EXPIRED),SORT(counts only live members), and the sorted-set operations that accept a set as input (ZUNIONand friends), which read the new listpack encoding but refuse a set that has member expirations, since a sorted set cannot keep them.Related refactor (separate commits, no behaviour change):
entry.c/.his renamedhash_entry.c/.hand its public functions get anhprefix (hEntry*); the new set entry uses ansprefix (sEntry*).New commands
All since 8.12.0, and mirror their
H*counterparts.SADDEX key [MNX | MXX] [EX | PX | EXAT | PXAT time | KEEPTTL] MEMBERS n member ...: add members and optionally set their expiration; existing members get their expiration set, or discarded unlessKEEPTTL.MNX/MXXare all-or-nothing conditions on the members. Replies 1 if at least one member was added, updated or deleted, 0 otherwise (an expiration in the past deletes the members).SEXPIRE,SPEXPIRE: set an expiration relative to now, in seconds / milliseconds, withNX | XX | GT | LT.SEXPIREAT,SPEXPIREAT: set an absolute Unix-time expiration, in seconds / milliseconds, with the same conditions.STTL,SPTTL: remaining time to live of each member, in seconds / milliseconds.SEXPIRETIME,SPEXPIRETIME: absolute expiration of each member, in seconds / milliseconds.SPERSIST: remove the expiration of each member.Existing set commands keep their syntax and reply format; only their treatment of expired members changes.
Keyspace and subkey space notifications
New events, all in the
s(set) class:sexpireSEXPIREfamily,SADDEX(expiration set or updated on existing members),SMOVE(expiration carried to the destination)spersistSPERSIST,SMOVE(destination member loses its expiration)sexpiredSADDEXand theSEXPIREfamily also firesadd/srem(members added, or deleted by a time in the past), anddelwhen the set becomes empty. A command that changes nothing fires no event.The events carry the affected members as subkeys, like the hash field events, so with the subkey flags of
notify-keyspace-eventsa subscriber learns which members changed without reading the set:S(__subkeyspace@<db>__:<key>, payload<event>|<subkeys>),T(__subkeyevent@<db>__:<event>),I(__subkeyspaceitem@<db>__:<key>\n<subkey>, one message per member) andV(__subkeyspaceevent@<db>__:<event>|<key>). The subkey-carrying events aresexpire,spersist,sexpiredand, when fired bySADDEXand theSEXPIREfamily,saddandsrem;SMOVEand the existing set commands fire the plain events as before. The subkey channels reuse the existing subkey notification machinery and need no new configuration.Tests
Mostly in the new
tests/unit/type/set-member-expire.tcl(about 100 tests), written as a matrix over the listpackex and hashtable encodings where the behaviour is shared:subexpiresacross the key lifecycle) and cluster slots;*STOREvariants, keyspace notifications and canonical propagation;DEBUG RELOAD,DUMP/RESTORE, AOF rewrite, full sync, digest;SORT, module scan;createComplexDatasetintests/support/util.tclcan now set member expirations).A C unit test of
SetEntry(./redis-server test setentry) covers the entry layout, adding and removing an expiration, and defrag.Note
High Risk
Touches core key lifecycle, active expiration, RDB/AOF/replication, and a new on-disk format (RDB v17), so regressions could affect durability, cluster restore, or eviction timing alongside existing HFE paths.
Overview
Adds per-member expiration on sets (Set Member Expiration, SME), parallel to hash field expiration, so members can TTL independently without extra keys or sorted-set workarounds.
Commands (8.12.0):
SADDEX(add with optionalEX/PX/EXAT/PXAT/KEEPTTL,MNX/MXX), plusSEXPIRE/SPEXPIRE/SEXPIREAT/SPEXPIREAT,STTL/SPTTL,SEXPIRETIME/SPEXPIRETIME, andSPERSIST— same semantics as theH*family, withMEMBERSblocks.Storage: Sets can use listpack-with-expiry (
OBJ_ENCODING_LISTPACK_EX) or hashtable-with-expiry, where members may be plain SDS orSetEntry(member + optionalExpireMeta). Keys with any member expiry register indb->subexpires(previously hash-only); active expiry, rename/move/copy/RDB load, keymeta growth, and defrag all go through sharedtypeMaySubexpire/kvobjGetMinSubexpirydispatch.Behavior: Expired members are lazy-invisible to most reads (
SET_ITER_SKIP_EXPIRED, scan, modules,SORT, etc.);SCARDmay still count not-yet-reclaimed expired members. Replication/AOF use canonicalSADDEX/SPEXPIREAT; AOF rewrite batches non-expiring members withSADDand emitsSADDEXper expiring member.Persistence:
RDB_VERSION17 withRDB_TYPE_SET_LISTPACK_EXandRDB_TYPE_SET_METADATA;*STOREset ops preserve member TTLs with defined merge rules.Refactor (no behavior change): hash
Entry→HashEntry(hash_entry.*,hEntry*APIs); set logic gains encoding ops table and drops splitt_set_*objects in favor ofset_entry.cand consolidatedt_set.c.Reviewed by Cursor Bugbot for commit 7b43f3e. Bugbot is set up for automated code reviews on this repo. Configure here.