Skip to content

fix: bitop cross-shard correctness; update test count - #330

Merged
kacy merged 2 commits into
mainfrom
fix/bitop-and-test-count
Feb 27, 2026
Merged

fix: bitop cross-shard correctness; update test count#330
kacy merged 2 commits into
mainfrom
fix/bitop-and-test-count

Conversation

@kacy

@kacy kacy commented Feb 27, 2026

Copy link
Copy Markdown
Owner

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_groups invariant 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 failed
  • cargo test -p ember-integration-tests --test integration -- --test-threads=1 — 179 passed, 0 failed
  • cargo clippy --workspace --features protobuf,grpc -- -D warnings — clean
  • cargo fmt --all — clean

kacy added 2 commits February 26, 2026 21:39
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.
@kacy
kacy merged commit 7f9d76f into main Feb 27, 2026
7 of 8 checks passed
@kacy
kacy deleted the fix/bitop-and-test-count branch February 27, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant