miroir/crates/miroir-core/tests
jedarden 5c76c4e7ea P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure)
Implement anti-entropy reconciler with fingerprint → diff → repair pipeline
to detect and repair replica drift.

**Core Implementation (anti_entropy.rs):**
- Fingerprint step: xxh3 digest over (pk || content_hash) with per-bucket hashes
- Diff step: bucket-based (pk-hash % 256) divergence isolation
- Repair step: TTL-aware authoritative doc selection with CDC origin tagging
- Mode A scaling: rendezvous-based shard partitioning for multi-pod deployments
- Cross-index comparison: PK-keyed bucketing for reshard verification

**Worker (anti_entropy_worker.rs):**
- Leader election for single-pod execution
- Schedule parsing ("every 6h" format)
- HTTP node client for Meilisearch communication
- Metrics callbacks integration

**Acceptance Criteria Met:**
1. Induce divergence → reconciler detects within schedule interval and repairs
2. Expired-doc test: stale write with older updated_at does NOT resurrect expired docs
3. CDC suppression: anti-entropy writes filtered by _miroir_origin tag
4. Mode A: 3 pods each own ~1/3 shards; runs exactly once per shard cluster-wide

**Tests:**
- 9 core acceptance tests pass
- 10 fingerprint step tests pass
- 12 diff step tests pass
- 9 TTL interaction tests pass

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 11:19:57 -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
merger_proptest.rs P1.6: Verify property tests and benchmarks for router 2026-05-23 10:21:56 -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 P6.5: Mode C work-queued chunked jobs - complete worker processing logic 2026-05-23 07:04:53 -04:00
p3_task_store_proptest.rs P6.5: Mode C work-queued chunked jobs - complete worker processing logic 2026-05-23 07:04:53 -04:00
p4_topology_chaos.rs P4: Phase 4 Topology Operations — rebalancer, migration executor, chaos tests 2026-05-02 16:50:42 -04:00
p13_7_alias_acceptance_tests.rs P5.7 §13.7: Complete alias acceptance tests 2026-05-23 01:54:05 -04:00
p13_8_anti_entropy.rs P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 10:55:01 -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
p43_node_drain.rs P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:19:57 -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