Implements P5.1 online resharding via shadow index (plan §13.1):
1. Admin API background orchestrator:
- POST /_miroir/indexes/{uid}/reshard now spawns background task
- Background task runs full execute_reshard orchestrator (phases 2-6)
- Registry updates track phase transitions
- Returns operation ID for status monitoring
2. CLI admin API integration:
- miroir-ctl reshard --start now calls POST /_miroir/indexes/{uid}/reshard
- miroir-ctl reshard --status calls GET /_miroir/indexes/{uid}/reshard/status
- Proper error handling and progress reporting
- Passes admin_key and api_url through to sub-functions
3. Six-phase flow (all phases already implemented):
- Phase 1: Shadow create (shadow_create_phase)
- Phase 2: Dual-hash dual-write (prepare_dual_write_documents)
- Phase 3: Backfill (backfill_phase) with throttling
- Phase 4: Verify cross-index PK sets (verify_phase)
- Phase 5: Alias swap (alias_swap_phase)
- Phase 6: Cleanup (cleanup_phase) after retention
Acceptance criteria addressed:
- Full orchestrator runs in background after shadow creation
- CLI connects to admin API (no longer dry-run only)
- Metrics callback placeholder added for phase transitions
- All 76 resharding tests pass
Closes: miroir-uhj.1
|
||
|---|---|---|
| .. | ||
| miroir-core | ||
| miroir-ctl | ||
| miroir-proxy | ||