miroir/crates/miroir-proxy/tests
jedarden ad5877a7e5 feat(reshard): implement backfill phase with pagination and rehashing
Implements plan §13.1 step 3: background streamer pages every live-index
shard using `filter=_miroir_shard={id}`, re-hashes each document under
the new shard count, and writes to the shadow index with the new shard
assignment. Documents are tagged with `origin: "reshard_backfill"` for
CDC event suppression (plan §13.13).

Key changes:
- Added imports for FetchDocumentsRequest, WriteRequest, and json
- Implemented `advance_backfill()` with full pagination loop
- Fetches documents from live index using shard filter
- Extracts primary key from each document
- Re-hashes PK under new shard count using twox-hash
- Injects `_miroir_shard = new_shard_id` into document
- Writes to shadow index with origin tag for CDC suppression
- Tracks progress (total/processed documents, current shard)
- Applies throttling based on configured rate limit
- Made `hash_pk_to_shard()` public for test visibility
- Added tests for document rehashing and executor state

Tests: All 104 reshard tests pass, including new tests for:
- Document rehashing under new shard count
- Executor initialization with correct state
- Backfill progress tracking

Closes: bf-54tf
2026-05-26 08:05:45 -04:00
..
docker_compose_integration.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
error_format_parity.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
header_contract.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
integration_test.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p2_2_write_path_acceptance.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p2_5_task_reconciliation.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p2_8_middleware_acceptance_tests.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p2_phase2_dod.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p3_phase3_task_registry.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p5_1_d_reshard_verify.rs feat(reshard): implement backfill phase with pagination and rehashing 2026-05-26 08:05:45 -04:00
p5_1_e_reshard_alias_swap.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p5_5_two_phase_settings_broadcast.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p5_8_a_anti_entropy_fingerprint.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p5_8_b_anti_entropy_diff.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p5_14_ttl_automatic_expiration.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p6_7_resource_pressure_metrics.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p7_1_core_metrics.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p7_5_structured_logging.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p7_6_opentelemetry.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p10_2_node_master_key_rotation.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p10_5_scoped_key_rotation.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p10_6_csrf_posture.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p10_7_admin_login_rate_limit.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p10_admin_session_revocation.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p13_6_session_pinning.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p13_7_alias_resolution.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p13_7_full_alias_integration.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
p13_19_admin_ui_2pc_preview.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
p24_index_lifecycle.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-26 01:14:31 -04:00
p29_reserved_field_rejection.rs fix(clippy): auto-fix format strings and deprecated IndexMap::remove 2026-05-25 21:31:17 -04:00
phase2_integration_test.rs fix(cli): add --version and --help flags to miroir-proxy 2026-05-26 03:02:56 -04:00
README_integration.md P9.2: Integration test harness with docker-compose 2026-05-23 07:33:34 -04:00