Event-storage E3: consume Weasel 9.16.0 — storage hierarchy + ops move to Weasel.Storage (closes the #4821 event move) - #4901
Merged
Conversation
… in Weasel.Storage Final slice of the #4821 event-storage move. Consumes Weasel 9.16.0 (weasel#343), which relocated the closed-shape event storage hierarchy + operations (with new neutral op bases) into the shared Weasel.Storage package. This unblocks Polecat's SQL Server event dialect. Deleted from Marten (now in namespace Weasel.Storage): - EventStorage<TId> + Rich/Quick/QuickWithServerTimestamps storages + EventStorageBuilder - The per-event, insert-stream, update-stream, and assert-stream-version operations Marten-side adaptation: - ClosedShapeEventDocumentStorage constructs the Marten-resident PostgresEventStoreDialect and passes it into the now-dialect-agnostic EventStorageBuilder.Build (which used to construct the dialect itself). EventStorage<TId> is fully-qualified since the enclosing Marten.EventStorage namespace shadows the simple name. - The closed-shape ops implement only the neutral Weasel.Storage.IStorageOperation, so the event-op contract (IEventStorage / EventDocumentStorage / the adapter overrides) widens to the neutral type. The session's QueueOperation already accepts neutral; the tombstone operations list widens to match. - The InsertStream unique-violation -> ExistingStreamIdCollisionException translation (which is Postgres-specific and could not move to the neutral base) is reinstated as the descriptor's TransformInsertStreamException closure, supplied by PostgresEventStoreDialect. The neutral InsertStreamOperationBase invokes it via IExceptionTransform. - EventTracingConnectionLifetime's verbose-tracing probe now matches the neutral Weasel.Storage.AppendEventOperationBase (the only append path in v9). PostgresEventStoreDialect, the two bulk QuickAppendEvents ops, ClosedShapeEventDocumentStorage, ClosedShapeStreamStateQueryHandler, and StreamStateSql stay in Marten. Validated (net10): EventSourcingTests all deterministic pass (1 unrelated outbox parallelism flake, green in isolation), TenantPartitionedEventsTests 228; full solution Debug + Release clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 8, 2026
Closed
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.
The final slice of the #4821 closed-shape event-storage extraction. Consumes Weasel 9.16.0 (weasel#343), which relocated the event storage hierarchy + operations (with new neutral op bases) into the shared
Weasel.Storagepackage. This unblocks Polecat's SQL Server event dialect.Follows E0 (#4885), E1 (#4898), E2 (#4900) — all merged.
Moved to
Weasel.Storage(deleted from Marten here — 16 files)EventStorage<TId>+ the Rich / Quick / QuickWithServerTimestamps storages +EventStorageBuilderMarten-side adaptation
ClosedShapeEventDocumentStorageconstructs the Marten-residentPostgresEventStoreDialectand passes it intoEventStorageBuilder.Build(which used tonewthe dialect itself).EventStorage<TId>is fully-qualified since the enclosingMarten.EventStoragenamespace shadows the simple name.Weasel.Storage.IStorageOperation, soIEventStorage/EventDocumentStorage/ the adapter overrides return the neutral type.QueueOperationalready accepts neutral; the tombstone operations list widens to match. No per-op wrapper on the append hot path.ExistingStreamIdCollisionExceptionmapping couldn't move to the neutral base, so it's supplied as the descriptor'sTransformInsertStreamExceptionclosure byPostgresEventStoreDialect; the neutralInsertStreamOperationBaseinvokes it viaIExceptionTransform. (This was caught by the test suite — 14 collision tests — and fixed.)EventTracingConnectionLifetimenow matches the neutralWeasel.Storage.AppendEventOperationBase(the only append path in v9).Staying in Marten:
PostgresEventStoreDialect, the two bulkQuickAppendEventsops,ClosedShapeEventDocumentStorage,ClosedShapeStreamStateQueryHandler,StreamStateSql.Validation
Bug_4441_force_catch_up_with_outbox, outbox/message-batch lifecycle) is a local-parallelism flake — green in isolation, and CI runs with parallelization disabled.Marten.slnxDebug + Release cleanWith this merged, the Marten side of the #4821 closed-shape event-storage move is complete.
🤖 Generated with Claude Code