Skip to content

10.0.0-alpha.4

Pre-release
Pre-release

Choose a tag to compare

@jeremydmiller jeremydmiller released this 16 Nov 01:28
· 90 commits to master since this release
3b38fe2

Fourth alpha of Weasel 10.0 for the Critter Stack .NET 11 release train. Targets net10.0 and net11.0. See the 10.0 migration guide.

⚠️ Anyone on alpha.3 should move: it can issue Hi-Lo ids out of order (below).

Hi-Lo: ids only increase across a sync/async overlap (#840)

  • A regression from alpha.3's #833, caught by Marten's CI on its alpha.3 pin bump (JasperFx/marten#5984). Since #833 a synchronous and an asynchronous advance can overlap. The one that started first could come back with the lower block after callers had drawn ids from the higher one, and ids went backwards (… 2137, 2134 …). No id was ever issued twice.
  • A block that arrives after another advance installed a higher one is now dropped as a gap. Outside an overlap, TrySetCurrentHi installs what it is given, as before, so a reset hilo row keeps working.
  • Marten's hilo_prefetch_tests against this build: 0 failures in 20 runs, where alpha.3 failed 1 in 20.

Synchronous tenant resolution (#838, #841)

  • New MasterTableTenancyBase.TryResolveTenant(tenantId, out resolution) resolves from the cache, or with one blocking read of the control table, into the same cache. There is no Task in the chain, so a store's synchronous GetTenant stops blocking pool threads for a cold tenant (JasperFx/marten#5985).
  • It returns false instead of blocking when it can't avoid async work, and the caller falls back to ResolveTenantAsync. That happens before the control table is provisioned, under Multiplexing=true, or for a dialect without SelectTenantRow.
  • New protected virtuals SupportsSynchronousControlTableReads and ExecuteSynchronously<T>.

Synchronous find-or-create for single-server databases (#839, #842)

  • New SingleServerDatabaseCollection<T>.FindOrCreateDatabaseSynchronously(string): the same work as FindOrCreateDatabase over a synchronous connection, into the same cache. It never waits on the lock async callers hold.
  • CREATE DATABASE on both paths now ignores losing a race for the same name, whether to the other path or to another process.
  • Also on the 9.x line (#843), unreleased there.

Event loader: an interface or abstract type reads everything (#845, #847)

  • EventTypeAllowList.For returns All when an included type is an interface, abstract, or object, as from IncludeType<IDomainEvent>() or Apply(IDomainEvent e). Their alias matches no stored row, so the pushed-down filter used to drop every implementing event while the shard reported itself caught up. This is Marten's rule. New EventTypeAllowList.CannotBeAStoredType.

Event paging: any list length in one statement (#846, #848)

  • IEventPagingDialect now states that a dialect must render an event-type allow list of any length, bound as a single parameter. SQL Server refuses more than 2,100 parameters. The SQL Server shape is openjson(@types) with (value varchar(500) '$'). Type the with clause to the column: untyped, it converts the column and scans the index.

All changes are additive, with no new interface members and no changed signatures.

Full Changelog: 10.0.0-alpha.3...10.0.0-alpha.4