miroir/crates
jedarden 0ade87a3de test(mode-a): pin rendezvous minimal-reshuffling on peer-set resize (bf-4t3o4)
Add the genuinely-missing Mode A partitioning assertions for plan §14.5:
survivor stability on both 3->2 (scale-down) and 3->4 (scale-up) peer-set
resizes. The existing pod-reassignment test only checks that a removed pod's
shards are re-homed -- it does NOT pin that surviving pods keep the shards they
already owned, so a churn-inducing partitioner would pass it silently. This is
the regression parent bf-30m2j is actually worried about (two pods churning
ownership in a multi-replica HA deployment).

Enabling infra (required so the test compiles under `cargo test -p miroir-core
mode_a` with no --features):
- lib.rs: un-gate `mode_a_coordinator` and `peer_discovery` -- only the DNS
  `refresh()` path needs the optional `peer-discovery` feature (gated inside
  the function); the types and the test-only `set_peer_set_for_test` do not.
- mode_a_coordinator.rs: widen `set_peer_set_for_test` to
  `cfg(any(test, feature = "test-helpers"))` so integration tests in other
  crates can also reach it. No new feature flag -- `test-helpers` already
  exists and is already used by miroir-proxy.

Tests (anti_entropy.rs, new `mode_a_minimal_reshuffling_tests` module):
- scale_down_survivor_stability: on 3->2, pod-1/pod-2 keep every shard they
  owned at 3 pods; only pod-3's departed shards may change hands.
- scale_up_survivor_stability: on 3->4, exactly-one-owner + full coverage at 4
  pods, and each original pod keeps its shards except those the new pod-4
  takes over (no shard moves between original pods).

Verified the assertions bite: a round-robin partitioner `peers[s % N]`
satisfies exactly-one-owner but violates survivor stability (21 violations on
3->2, 30 on 3->4), so these tests fail under round-robin and pass only under
rendezvous. The in-source comment cites concrete shards (4 on 3->2, 5 on 3->4).

Full lib suite in default config: 744 passed, 0 failed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-10 16:24:55 -04:00
..
miroir-core test(mode-a): pin rendezvous minimal-reshuffling on peer-set resize (bf-4t3o4) 2026-07-10 16:24:55 -04:00
miroir-ctl feat(explain): display IncompleteIntegration warnings in CLI 2026-05-26 21:03:36 -04:00
miroir-proxy fix(ci): enable kafka-sink feature in CI build and Dockerfile 2026-05-31 12:08:39 -04:00