Fix #4526/#4528: revert IRevisioned to int + add ILongVersioned (long)#4533
Merged
Conversation
…d (long) support Marten 9.0-alpha forked IRevisioned to long Version. #348 keeps the canonical JasperFx.IRevisioned at int and adds JasperFx.ILongVersioned (long) for documents projected from a MultiStreamProjection whose Version is the global event sequence number. This consumes both and keeps the bigint mt_version column. Production: - Delete Marten.Metadata.IRevisioned (long); alias IRevisioned -> JasperFx.IRevisioned (int) and ILongVersioned -> JasperFx.ILongVersioned (long) in the shared dedupe file. - VersionedPolicy recognizes both IRevisioned and ILongVersioned -> UseNumericRevisions, mapping Metadata.Revision.Member. - MetadataColumn<T>.Member gains a virtual IsAcceptableMemberType hook; RevisionColumn overrides it to accept int (IRevisioned) or long (ILongVersioned). Column stays bigint. - DocumentRevisionBinder builds a member-type-aware setter: for an int member it downcasts the loaded long (documented overflow caveat for huge event sequences); for a long member it assigns directly. - DocumentSessionBase.storeEntity gains an ILongVersioned case beside IRevisioned; revision flows as long internally (int upcasts). Tests/examples: the revision-counter docs that had adopted the alpha long signature revert to int Version (all are single-stream revision docs). Added long_versioned_revisioning with an ILongVersioned doc whose Version > Int32.MaxValue round-trips through the bigint column without truncation. Docs: concurrency.md documents IRevisioned (int) vs ILongVersioned (long) and the int-overflow caveat for MultiStreamProjection-derived documents. Full solution builds clean (net9/net10). Revision/concurrency tests: DocumentDbTests numeric + long revisioning 24/0; EventSourcing FetchForWriting/compacting/last-good 227/0. Closes #4526 and #4528. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
jeremydmiller
added a commit
that referenced
this pull request
May 20, 2026
… (#4534) * Marten docs: rewrite stale IRevisioned int->long migration-guide section for the #4533 revert An early 9.0 alpha widened IRevisioned.Version to long; #4533 reverted that before rc.1 (IRevisioned stays int, V8-compatible) and added ILongVersioned (long) for MultiStreamProjection documents whose Version is the global event sequence number. The migration guide still told users to widen Version to long. Rewrite the section to lead with the reversal, introduce ILongVersioned with the Int32-overflow rationale, and replace the widen-to-long example with a correct IRevisioned(int)/ILongVersioned(long) pair. Every Before|After type in the table was verified against origin/master source: IRevisioned.Version is int (unchanged); DocumentMetadata.CurrentRevision, UpdateRevision/TryUpdateRevision parameters, IRevisionedOperation.Revision and the m.Revision metadata column are long (and source-compatible via int->long). Dropped the stale claim that MapTo to an int property throws (RevisionColumn now accepts int or long). References updated to #4533 / #4526 / #4528 / #348; #3733 / #4377 are historical. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Marten docs: regenerate concurrency.md sample_versioned_reservation snippet (int Version) The embedded sample_versioned_reservation snippet still showed long Version even though its source (src/Marten.Testing/Examples/RevisionedDocuments.cs) was already reverted to int by #4533. Regenerated via mdsnippets so the embed matches source. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Marten 9.0-alpha had forked
IRevisionedto along Version. Upstream #348 keeps the canonicalJasperFx.IRevisionedatint(matching Marten 8) and introduces a newJasperFx.ILongVersioned(long Version) for documents projected from aMultiStreamProjectionwhoseVersionis the global event sequence number and can therefore exceedInt32.MaxValue. This PR consumes both and keeps thebigintmt_versioncolumn for everyone.This is the focused follow-up that was split out of the dedupe-consumption work (foundation landed in #4529; coordinator/hilo refactors in #4532).
Changes
Marten.Metadata.IRevisioned(long); aliasIRevisioned -> JasperFx.IRevisioned(int) andILongVersioned -> JasperFx.ILongVersioned(long) in the shared dedupe file.VersionedPolicyrecognizes bothIRevisionedandILongVersioned->UseNumericRevisions+ mapsMetadata.Revision.Member.MetadataColumn<T>gains a virtualIsAcceptableMemberTypehook;RevisionColumnoverrides it to acceptint(IRevisioned) orlong(ILongVersioned). The column staysbigint.DocumentRevisionBinderbuilds a member-type-aware setter: anintmember downcasts the loadedlong; alongmember is assigned directly.DocumentSessionBase.storeEntitygains anILongVersionedcase besideIRevisioned; revision flows aslonginternally (intupcasts).longsignature revert toint Version.[Version]-attribute docs staylong.long_versioned_revisioning— anILongVersioneddoc whoseVersion > Int32.MaxValueround-trips through thebigintcolumn without truncation.concurrency.mddocumentsIRevisioned(int) vsILongVersioned(long) and the int-overflow caveat forMultiStreamProjection-derived documents.Test plan
DocumentDbTestsrevisioning suite (long_versioned_revisioning+numeric_revisioning): 24 passed / 0 failed.docs/documents/concurrency.md.Closes #4526
Closes #4528
Refs #348, #4529, #4532
🤖 Generated with Claude Code