fix: bitop cross-shard correctness; update test count - #330
Merged
Conversation
bitop dispatched all work to dest's shard, so source keys on other shards were read as empty buffers — producing wrong results. fix reads each source from its own shard via route_multi, computes the bitwise result in the connection layer, then writes to dest's shard. also fixes cli command sort order: FLUSHALL was added after FLUSHDB (pr #324) and MEMORY USAGE was placed before INFO, both violating the alphabetical invariant checked by commands_sorted_within_groups.
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.
summary
two fixes from the full test suite run:
bitop cross-shard bug: BITOP dispatched everything to the destination key's shard and read source keys from that shard's local keyspace. any source key hashing to a different shard was treated as an empty buffer, silently producing wrong results. the fix reads each source key from its own shard via
route_multi, computes the bitwise result in the connection layer, then writes to dest's shard — the same pattern used by MGET/MSET for cross-shard fan-out.cli command sort order: FLUSHALL and MEMORY USAGE were added out of alphabetical order in pr #324, breaking the
commands_sorted_within_groupsinvariant test. corrected to ACL → BGREWRITEAOF → BGSAVE → CONFIG → DBSIZE → FLUSHALL → FLUSHDB → INFO → LASTSAVE → MEMORY USAGE → MONITOR → ROLE → SLOWLOG → TIME.readme: test count updated to 1,690+ (1,511 unit + 179 integration).
what was tested
cargo test --workspace --features protobuf,grpc --exclude ember-integration-tests— 1,511 passed, 0 failedcargo test -p ember-integration-tests --test integration -- --test-threads=1— 179 passed, 0 failedcargo clippy --workspace --features protobuf,grpc -- -D warnings— cleancargo fmt --all— clean