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>
|
||
|---|---|---|
| .. | ||
| miroir-core | ||
| miroir-ctl | ||
| miroir-proxy | ||