Repository navigation
Conversation
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.
… 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.
…re-add only the SER011 StringBitPositions entries to Unshipped)
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.
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.
Implements the Redis 8.12
BITRANGEINTARRAYcommand (redis/redis#15986, part of the native bitmap work in redis/redis#15331). The plan is innotes/bitrangeintarray/plan.md; the implementation follows it.API
The enumerating sibling of
StringBitPosition(BITPOS): samekey, bit, start, end, indexTypeshape and defaults, withlimitadded beforeflags.bit: falsesendsZEROS;StringIndexType.BitsendsBIT, and the defaultBYTEis omitted exactly asBITPOS/BITCOUNTdo. Negativelimitthrows client-side. The reply is a flat integer array, soResultProcessor.Int64Arrayis reused, and the argument tail fits an existingMessage.Createoverload: no new types, no new processor. Replica-eligible, from theREADONLYflag. The XML remarks carry the paging rule (BIT: next start is last + 1; BYTE: the server completes the byte, next start is last / 8 + 1).Verified
dotnet build Build.csproj -c Release /p:CI=trueclean.RoundTripUnitTests.BitPositionsRoundTrip: exact wire bytes for every option combination,LIMIT 0, and the two client-side argument checks.BitTests.StringBitPositions_*(ranges, clear bits, limit, paging without gaps in both units, missing key andWRONGTYPE), gatedCreate(require: RedisFeatures.v8_12_0): green on RESP2 and RESP3 against a local build of unstable at 6a5fee67, which reportsredis_version:255.255.255(and originally skipped on the docker topology).bitmap-roaringone; the plan records them as observed.RedisFeatures.v8_12_0is now pinned to8.11.241, which is what RC2 reports — the8.12.0placeholder would have made the gated tests skip on RCs. The docker topology / CI default image is nowredislabs/client-libs-test:8.12-rc2, withcluster-bus-port-protected-mode noadded to the test cluster configs (RC2 introduces that check and otherwise refuses to start a plaintext cluster node). AllStringBitPositionslive and round-trip tests pass against the RC2 topology; the wire syntax (key start end [BYTE|BIT] [LIMIT n] [ZEROS], set bits by default) and the missing-key/WRONGTYPEbehaviour are unchanged on RC2.Shared with #3261 (BLESS)
Both are 8.12, so this adds the same gating pieces with identical text:
Experiments.Server_8_12 = "SER011", theSER011NoWarnentry,RedisFeatures.v8_12_0(pinned to8.11.241, the RC2 version), anddocs/exp/SER011.md. Whichever lands second merges textually, except the feature list indocs/exp/SER011.md, which needs both bullets.Also
BITRANGEINTARRAYrow fromdocs/CommandCoverage.md; the audit script reconciles.Lease<long>variant for dense bitmaps, and anIAsyncEnumerable<long>paging helper.RC2 ZSCAN duplicates (server behavior change, handled)
The only CI failures on the RC2 image are the 8
ScanTests.SortedSetScanLargecases (all page sizes, RESP2+RESP3): a fullZSCANiteration over a stable 2000-element sorted set returns 2001-2003 entries, with a few members duplicated. Reproduced with pureredis-cliagainstredislabs/client-libs-test:8.12-rc2(deterministic per dataset;ZCARDis 2000, distinct members 2000), clean onredis:8.2, andHSCAN/SSCANare unaffected — a ZSCAN behavior change in the 8.12 btree zset encoding, reported upstream as redis/redis#16158.SortedSetScanLargenow asserts the distinct member count, so CI is expected green; revisit if redis/redis#16158 is fixed before GA. Everything else was already green (6700+ tests).