Add binary-serialization upgrade test (#4515)#4581
Merged
jeremydmiller merged 1 commit intoMay 28, 2026
Conversation
Proves the headline coexistence-design promise on a real upgrade path: 1. Build a DocumentStore against a fresh schema with NO binary serialization wired and append JSON-only events. 2. Dispose; build a SECOND DocumentStore against the SAME connection + SAME schema, with `opts.Events.UseMemoryPackSerializer()` as the only configuration delta. 3. Append BINARY events (MemoryPack) to the same stream. 4. Read the whole stream back — both JSON-serialized rows (Phase 1) and binary-serialized rows (Phase 2) replay in correct order with monotonic version numbers. 5. Append one more JSON event from Phase 2 — proves the JSON path still works in a binary-enabled store, on the same stream. 6. Inspect raw `data` / `bdata` columns to verify the row-level discriminator: Phase 1 rows have `bdata = NULL`, Phase 2 binary rows have `bdata != NULL`, the Phase 2 JSON-typed row has `bdata = NULL`. This complements the existing `pre_existing_json_rows_still_read_after_feature_is_in_place` test, which only covered single-store JSON-only rows. The new test exercises the *two-store* upgrade story — a fresh `DocumentStore` / `EventGraph` /`EventStorage` for Phase 2 must pick up the existing data + handle the format switch on the same physical stream. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 29, 2026
Open
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.
Follow-up to #4578 (binary event serialization Phase 1).
What
Adds
binary_serialization_upgrade_tests.enabling_binary_serialization_on_existing_store_still_reads_old_json_events_and_appends_new_binary— proves the headline coexistence-design promise on a real upgrade path that #4578's existing tests don't quite cover:DocumentStoreagainst a fresh schema with no binary serialization wired, append JSON-only events. Dispose.DocumentStoreagainst the SAME connection + SAME schema, withopts.Events.UseMemoryPackSerializer()as the only configuration delta. Append binary events (MemoryPack) to the same stream.{1, 2, 3, 4}).data/bdatacolumns to verify the row-level discriminator: Phase 1 rows havebdata = NULL, Phase 2 binary rows havebdata != NULL, the Phase 2 JSON-typed row hasbdata = NULL.Why a new test
#4578's
pre_existing_json_rows_still_read_after_feature_is_in_placeonly covered a single store with both modes. This test exercises the two-store upgrade story — a freshDocumentStore/EventGraph/EventStoragefor Phase 2 must pick up the existing data + handle the format switch on the same physical stream. That's the path a real user takes when they enable the feature on a deployed system.Result
Marten.MemoryPack.Testssuite still 6/6.🤖 Generated with Claude Code