Add EnableBigIntEvents flag for 64-bit event sequences#4250
Merged
jeremydmiller merged 2 commits intomasterfrom Apr 14, 2026
Merged
Add EnableBigIntEvents flag for 64-bit event sequences#4250jeremydmiller merged 2 commits intomasterfrom
jeremydmiller merged 2 commits intomasterfrom
Conversation
Introduces an opt-in EnableBigIntEvents flag on StoreOptions.Events that switches the mt_quick_append_events PostgreSQL function to use bigint types for event version, sequence, and return values. This prevents integer overflow when sequence values exceed the ~2.1 billion int32 limit. The flag defaults to false for backward compatibility and will become true by default in Marten 9.0. Includes 6 tests verifying behavior with the flag both enabled and disabled, and documentation in the event store configuration guide. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 15, 2026
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 #4246
StoreOptions.Events.EnableBigIntEventsopt-in flag (defaults tofalse) that switches themt_quick_append_eventsPostgreSQL function to usebiginttypes for event version, sequence, and return valuesint32limittruein Marten 9.0Test plan
default_flag_is_false— verifies backward-compatible defaultevents_work_with_bigint_enabled— end-to-end event append/read with flag onevents_work_with_bigint_disabled— end-to-end event append/read with flag offsequence_above_int32_max_with_bigint_enabled— verifies sequences beyond 2.1B workquick_append_function_uses_bigint_when_enabled— DDL inspectionquick_append_function_uses_int_when_disabled— DDL inspection🤖 Generated with Claude Code