miroir/crates/miroir-core/tests
jedarden 690cefe04e P4.2 Node addition: dual-write + paginated shard migration
Implement plan §2 "Adding a node to an existing group":

1. Admin API endpoints now use Rebalancer methods:
   - POST /_miroir/nodes → Rebalancer.add_node()
   - POST /_miroir/nodes/{id}/drain → Rebalancer.drain_node()
   - DELETE /_miroir/nodes/{id} → Rebalancer.remove_node()

2. Node addition flow:
   - Mark node as `joining`
   - Recompute assignments → affected_shards where new node enters top-RF
   - Dual-write: writes go to both old owner and new node
   - Background migration via _miroir_shard filter (paginated)
   - Mark `active`; stop dual-write
   - Delete migrated shard from old node

3. Integration tests (p42_node_addition.rs):
   - 3→4 node migration with 10K docs
   - Chaos: writes during migration caught by dual-write
   - Performance: ≤ total_docs/(Ng+1) × 1.1 docs moved
   - Log inspection: old node not queried after migration
   - Pagination verification with limit/offset
   - Dual-write verification

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 15:15:35 -04:00
..
cutover_race.rs P12.OP1: Chaos-test cutover race window + hard refusal policy 2026-04-18 22:00:21 -04:00
dfs_skewed_corpus.rs P2.2: Implement write path with primary key validation, shard injection, and two-rule quorum 2026-04-19 06:48:30 -04:00
p3_redis_integration.rs P3: Update TaskStore to synchronous API and test improvements 2026-05-02 17:49:22 -04:00
p3_sqlite_restart.rs P3: Update TaskStore to synchronous API and test improvements 2026-05-02 17:49:22 -04:00
p3_task_store_proptest.rs P3: Update TaskStore to synchronous API and test improvements 2026-05-02 17:49:22 -04:00
p4_topology_chaos.rs P4: Phase 4 Topology Operations — rebalancer, migration executor, chaos tests 2026-05-02 16:50:42 -04:00
p22_write_path.rs P2.2: Implement write path with primary key validation, shard injection, and two-rule quorum 2026-04-19 06:48:30 -04:00
p23_search_read_path.rs P2.3: Clean up unused import in acceptance test 2026-04-19 06:44:39 -04:00
p42_node_addition.rs P4.2 Node addition: dual-write + paginated shard migration 2026-05-08 15:15:35 -04:00
router_proptest.proptest-regressions P1.5: Implement scatter module with covering-set construction + dispatch trait 2026-04-19 00:20:29 -04:00
router_proptest.rs P1.6: Add property tests and criterion benchmarks for router 2026-04-18 23:59:30 -04:00