Skip to content

Event-storage E3: consume Weasel 9.16.0 — storage hierarchy + ops move to Weasel.Storage (closes the #4821 event move) - #4901

Merged
jeremydmiller merged 1 commit into
masterfrom
feat/event-storage-e3-consume-weasel-9-16
Jul 8, 2026
Merged

Event-storage E3: consume Weasel 9.16.0 — storage hierarchy + ops move to Weasel.Storage (closes the #4821 event move)#4901
jeremydmiller merged 1 commit into
masterfrom
feat/event-storage-e3-consume-weasel-9-16

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

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.Storage package. 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 + EventStorageBuilder
  • The per-event, insert-stream, update-stream-version, and assert-stream-version operations

Marten-side adaptation

  • Builder is now dialect-agnostic. ClosedShapeEventDocumentStorage constructs the Marten-resident PostgresEventStoreDialect and passes it into EventStorageBuilder.Build (which used to new the dialect itself). EventStorage<TId> is fully-qualified since the enclosing Marten.EventStorage namespace shadows the simple name.
  • Event-op contract widened to neutral. The closed-shape ops implement only Weasel.Storage.IStorageOperation, so IEventStorage / EventDocumentStorage / the adapter overrides return the neutral type. QueueOperation already accepts neutral; the tombstone operations list widens to match. No per-op wrapper on the append hot path.
  • Reinstated the Postgres-specific stream-collision translation. The InsertStream unique-violation → ExistingStreamIdCollisionException mapping couldn't move to the neutral base, so it's supplied as the descriptor's TransformInsertStreamException closure by PostgresEventStoreDialect; the neutral InsertStreamOperationBase invokes it via IExceptionTransform. (This was caught by the test suite — 14 collision tests — and fixed.)
  • The verbose-tracing probe in EventTracingConnectionLifetime now matches the neutral Weasel.Storage.AppendEventOperationBase (the only append path in v9).

Staying in Marten: PostgresEventStoreDialect, the two bulk QuickAppendEvents ops, ClosedShapeEventDocumentStorage, ClosedShapeStreamStateQueryHandler, StreamStateSql.

Validation

  • EventSourcingTests (net10): all deterministic tests pass. One unrelated failure (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.
  • TenantPartitionedEventsTests (net10): 228 passed / 0 failed
  • Full Marten.slnx Debug + Release clean

With this merged, the Marten side of the #4821 closed-shape event-storage move is complete.

🤖 Generated with Claude Code

… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant