maoyouaa opened a new pull request, #3565:
URL: https://github.com/apache/kvrocks/pull/3565

   ## Summary
   
   - Align `BITFIELD` and `BITFIELD_RO` on bitmap keys with Redis bit ordering 
by reversing bits at the bitmap storage boundary.
   - Use a fixed 9-byte stack buffer for bitmap-to-bitfield conversion.
   - Add regression coverage for signed values, overflow modes, sparse bitmaps, 
missing data, and segment boundaries.
   
   ## Root cause
   
   Kvrocks bitmap segments store bits in LSB order, while `BITFIELD` interprets 
byte buffers in MSB order. The bitmap conversion path copied bytes directly, 
producing results inconsistent with Redis and with `GET`/`GETBIT`.
   
   ## Compatibility
   
   Bitmap values written by older versions through the incorrect `BITFIELD` 
path have no format marker and cannot be distinguished automatically. This 
change preserves the existing bitmap LSB storage format and fixes conversion at 
the `BITFIELD` boundary.
   
   ## Validation
   
   - Docker GCC build
   - Go `TestBitmap`
   - Redis 7 comparison for signed values, overflow behavior, and sparse reads
   - clang-format, focused clang-tidy, and `git diff --check`
   
   Closes #2500


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to