miroir/crates/miroir-proxy
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
..
src P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:19:57 -04:00
static Phase 5: Add Advanced Capabilities verification and UI static assets 2026-05-03 19:01:22 -04:00
tests P5.14 §13.14: Document and verify TTL + automatic expiration 2026-05-23 09:39:53 -04:00
Cargo.toml P4.1: Rebalancer background worker - verification complete 2026-05-23 08:11:31 -04:00