miroir/crates
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
..
miroir-core P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:19:57 -04:00
miroir-ctl P3: Phase 3 Task Registry + Persistence — COMPLETE 2026-05-02 16:50:42 -04:00
miroir-proxy P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:19:57 -04:00