Repository navigation
Conversation
…itions (#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.
…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
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.
…2 features (SER011)
…nly unexposed commands)
1 of 10 tasks
This branch has not been deployed
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.
Integration branch collecting the Redis 8.12 (RC2) feature work, previously reviewed and merged individually:
BITRANGEINTARRAY(bit enumeration):IDatabase.StringBitPositions/StringBitPositionsAsyncreturn the positions of set (or clear) bits in a byte or bit range of a string or native bitmap, with optional paging viaLIMIT.SetAddgainsExpirationoverloads ridingSADDEX(note: the bare form discards an existing member TTL — that is SADDEX's semantic, so plainSADDis not an equivalent fallback), plusSetMemberExpire,SetMemberGetTimeToLive,SetMemberGetExpireDateTimeandSetMemberPersistoverSEXPIRE/SPEXPIRE/SEXPIREAT/SPEXPIREAT/SPTTL/SPEXPIRETIME/SPERSIST, with thesexpiredkeyspace notification.BLESS(eviction protection): per-key eviction-protection flags viaIDatabase.KeyBless/KeyUnbless/KeyBlessFlagsand theBlessFlagsenum,IServer.BlessedKeysfor cursor-based enumeration, and thebless/unblesskeyspace notifications.All of the new surface is gated behind the
SER011experimental ID (Experiments.Server_8_12, docs indocs/exp/SER011.md) and version-gated onv8_12_0(RC2 reports8.11.241), so nothing lights up against older servers and the API remains subject to change until 8.12 goes GA.Supporting changes: the test topology moves to the
8.12-rc2client-libs image (withcluster-bus-port-protected-mode no, which the 8.12 image requires for the plaintext test cluster), andSortedSetScanLargenow counts distinct members because the 8.12 btree zset encoding can return ZSCAN duplicates for an unmodified key (redis/redis#16158).mainhas been merged back in so the branch also carries #3341 (CLUSTER SLOT-STATS,SER012) with the shared files reconciled; the merge is conflict-free against currentmain.