Skip to content

9.47.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 26 Oct 18:18
· 160 commits to master since this release
af2428c

One additive change for event store dialects built on Weasel.Storage, plus backfilled notes for 9.46.1. See the 9.47 notes.

Nothing public was removed and no signature changed. The two additions are init properties on the Quick descriptor classes — not interface members — so a published downstream assembly cannot fail to load against this.

A per-event Quick append can read back the sequence it drew

#747, contributed by @vpetrevski. The Weasel half of marten#5454.

The Quick append modes have two routes. Most appends go through the dialect-supplied bulk operation, which already reads back each event's sequence. The other is the per-event QuickAppendEventWithVersion INSERT, taken when a stream is starting or an existing stream has ExpectedVersionOnServer set — and there seq_id comes from an inlined server-side nextval() that nothing reads back, so the event keeps Sequence 0.

That matters for what happens next. A unit of work that fails after the INSERT has already burned the numbers it drew, and the tombstone batch written to fill them skips events whose Sequence is 0 — there is nothing to write a tombstone against. The numbers stay unfilled, and a reader treating the event sequence as gapless sees a hole that never closes.

QuickEventStorageDescriptor and QuickWithServerTimestampsEventStorageDescriptor each gain AppendEventSqlReturnsSequence. Setting it asserts that AppendEventSqlSuffix ends in a clause returning seq_id; the storage then wraps the operation so its PostprocessAsync writes the returned value onto IEvent.Sequence, which is what the bulk path already does. The wrapping is the subtlety: NoDataReturnedCall is the marker telling the unit-of-work walker not to advance the batched reader, and it sits on AppendEventOperationBase, so a subclass cannot drop it.

Release notes backfilled for 9.46.1

9.46.1 shipped on 2026-10-23 with a tag and a GitHub release but no page on the docs site. Both of its PostgreSQL fixes are now written up in the 9.46 notes, because both deserve a consumer's attention:

  • #730 (@lahma) — ForeignKey.TryToCorrectForLink appended to the live ColumnNames array one column at a time. When several databases migrate in parallel over the same cached Table instances, two migrations both saw the key one column short and both appended, the second onto the first one's result: 42830: number of referencing and referenced columns for foreign key disagree. The widened key then lives on the shared instance, so every later migration in that process renders it again — it does not clear on a retry.
  • #732 (@erdtsieck) — IndexDefinition.ChildIndexName past 63 bytes was truncated by PostgreSQL into the suffix, which is the only part distinguishing one partition's child from another's. Two partitions then asked for the same child name and the concurrent build failed on the second, on every rerun.

What changes for you

  • Nothing, unless you write an event store dialect on Weasel.Storage and set the new flag. It defaults to false, which is the 9.46 behaviour exactly.
  • If you set it, your AppendEventSqlSuffix must return seq_id. The flag is an assertion about your SQL, not a request for Weasel to rewrite it.
  • Rich mode is untouched — its side-effect replay path reads no result.