Implements plan §14.5 Mode C work-queued chunked jobs for large background operations (dump import, reshard backfill). ## Changes ### Core Implementation - mode_c_coordinator.rs: Job coordination with claim/reclaim/heartbeat - mode_c_worker/mod.rs: Worker loop for processing jobs - mode_c_worker/acceptance_tests.rs: Full acceptance test suite - reshard_chunking.rs: Shard-id range chunking for reshard backfill ### Database - migrations/005_jobs_chunking.sql: Add chunking fields (parent_job_id, chunk_index, total_chunks, created_at) with indexes ### Integration - admin_endpoints.rs: Add ModeCWorker to AppState - task_store: Updated to support chunking fields - All test fixtures updated with new NewJob fields ## Acceptance Tests Pass - 1 GB dump splits into 4× 256 MiB chunks; 3 pods claim in parallel - Claim expires in 30s; another pod resumes at last_cursor - HPA queue depth metric drives scaling (queue_depth > 10) - Two concurrent dumps interleave without starvation - Reshard backfill splits by shard-id range Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| static | ||
| tests | ||
| Cargo.toml | ||