miroir/crates
jedarden c620d7c18d feat(reshard): implement Phase 3 (backfill), Phase 6 (cleanup), and orchestrator (P5.1, miroir-uhj.1)
Implements the remaining phases of the six-phase online resharding flow from plan §13.1:

**Phase 3 (Backfill)**:
- backfill_phase(): streams documents from live to shadow index
- Pages through each shard using filter=_miroir_shard={id}
- Re-hashes each document under new shard count
- Writes to shadow with _miroir_origin: reshard_backfill for CDC suppression
- Supports throttling via throttle_docs_per_sec config
- Progress callback support for metrics emission

**Phase 6 (Cleanup)**:
- cleanup_phase(): deletes old index after retention period
- Configurable retention (default 48h) for emergency rollback
- Graceful handling of partial cleanup failures

**Orchestrator**:
- execute_reshard(): sequences all six phases
- Proper error handling and rollback before Phase 5
- Metrics callback for phase transitions (miroir_reshard_phase gauge)
- Returns comprehensive result with stats and verification status

Acceptance criteria addressed:
- Backfill throttles to configured throttle_docs_per_sec
- miroir_reshard_phase gauge transitions via metrics callback
- Mid-backfill failure triggers shadow deletion rollback
- Post-swap rollback supported via reverse alias flip (Phase 5)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 07:16:02 -04:00
..
miroir-core feat(reshard): implement Phase 3 (backfill), Phase 6 (cleanup), and orchestrator (P5.1, miroir-uhj.1) 2026-05-24 07:16:02 -04:00
miroir-ctl feat(proxy): implement streaming routed dump import (P5.9, §13.9) 2026-05-24 06:07:00 -04:00
miroir-proxy fix(task_store): restore TaskStore implementations from fix commit (bf-103h) 2026-05-24 07:09:35 -04:00