test(persist): v2 forward-compat — load with PERSIST_FORMAT_VERSION+1 - #65
Merged
Merged
Conversation
TODO.md §4 calls for "v1 snapshot loaded by v2 code → migrate or safe
fallback, no crash, no data corruption." The existing module covered the
policy with hardcoded v999 sentinels; this PR pins the contract to the
**actual constant + 1** so the tests self-update if the version is bumped.
New `mod v2_forward_compat` adds three tests covering all three
persistence sites:
* schema_v1_with_future_version_falls_back_and_rewrites_clean —
SchemaRegistry rewrite is at v_current with the new config's schemas
and no leakage from the bumped blob.
* backfill_v1_with_future_version_falls_back_and_rewrites_clean —
same contract for BackfillRegistry, including next_job_id field
presence post-fallback.
* part_meta_with_future_version_returns_format_error —
SimpleMapStore part meta.bin: no fallback (each part is opaque), so a
clean PersistError::Format("unsupported version ...") is the contract.
All three pass:
test tests::persist_format_versioning_tests::v2_forward_compat::part_meta_with_future_version_returns_format_error ... ok
test tests::persist_format_versioning_tests::v2_forward_compat::backfill_v1_with_future_version_falls_back_and_rewrites_clean ... ok
test tests::persist_format_versioning_tests::v2_forward_compat::schema_v1_with_future_version_falls_back_and_rewrites_clean ... ok
2 tasks
zzylol
added a commit
that referenced
this pull request
Apr 30, 2026
* §4 Serialization format versioning tests — mark done with #65 and document the three landed tests (schema / backfill / part_meta) including the no-data-corruption assertion. Adds a defense-in-depth follow-up note for a live-restart docker-compose variant. * §1 Cold-query fallback latency follow-up — point at #66 (benchmarks/run_full_eval.sh). The runner exists and can produce the ≤2× P99 number; only blocker now is the ASAP_COLD_STORE_ROOT CLI flag wiring in asap-query-engine main.rs (de-scoped per the paper review — flagged here so we don't lose the dependency chain). §2 (accuracy profile) and §5 (correctness proofs) intentionally untouched — those weren't in scope for this round.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the open item in
TODO.md§4 ("Serialization format versioning tests") with a self-updating contract test.The earlier modules covered the fallback policy with hardcoded
v999sentinels — useful but doesn't track if the version constant is bumped. This PR adds amod v2_forward_compatthat usesPERSIST_FORMAT_VERSION + 1directly, so the moment we bump v1 → v2 the test exercises the v1-snapshot/v2-code path without anyone touching test code.Three sites covered:
versionfield, asserts safe-fallback + rewrite at v_current with no schemas leaked from the bumped blob.next_job_idfield presence post-fallback (no data corruption).PersistError::Format("unsupported version ...").Test plan
cargo test --package query_engine_rust --lib tests::persist_format_versioning_tests::v2_forward_compat— 3 passed, 0 failed🤖 Generated with Claude Code