Skip to content

Weasel 10.0.0-alpha.2

Pre-release
Pre-release

Choose a tag to compare

@jeremydmiller jeremydmiller released this 13 Nov 16:41
· 100 commits to master since this release
4c31eda

Second 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.

Build: runtime-async on net11.0

  • Every Weasel assembly's net11.0 build is now compiled with runtime-async, as in Wolverine 7.0 and JasperFx 3.0 (plan decision D4) (#816, #818). net10.0 is unchanged.
  • Wolverine measured 38–84% fewer allocations with it on. Watch for differences in async stack traces, debugger stepping, and APM agents or profilers that hook async state machines.
  • If you build from source, opt out with -p:WeaselRuntimeAsync=false.

New seams for Marten, Polecat and Fisher (all additive)

  • Async Hi-Lo (#808, #820)
    • ISequence / HiloSequenceBase gain NextLongAsync / NextIntAsync. They fetch an exhausted allocation through the existing async AdvanceToNextHi, and complete synchronously when the id is pure arithmetic.
    • Sync and async callers share one gate. That gate is now a non-re-entrant SemaphoreSlim, so an AdvanceToNextHi override must not call back into NextLong.
  • Master-table tenancy (#809, #821)
    • MasterTableTenancyBase.BuildDatabasesAsync now evicts tenants removed or disabled on another node, through a protected virtual EvictStaleTenantAsync hook.
    • MasterTenantStatus, LookupTenantAsync / ResolveTenantAsync and CreateTenantRefusal tell a disabled tenant from an unknown one.
    • ⚠️ Fisher 2.0.0-alpha.1 needs an override to keep revoking tenants removed on another node (JasperFx/fisher#551).
  • Batch executor (#810, #823)
    • OperationBatchExecutor drains the reader after the walk, so an error behind an unread result set now surfaces instead of being swallowed.
    • It also adds a surplus-result-set guard, IStorageOperationWrapper so NoDataReturnedCall is still seen through adapters, and an IOperationBatchListener for per-command logging and exception transforms.
  • Closed-shape storage (#811, #822)
    • The tracking-mode bases are public.
    • IClosedShapeStorageRules gains undelete, restore and mapped-version write-back.
    • New ClosedShapeSubClassDocumentStorage for hierarchies.

Performance

  • Parameter-type lookups allocate nothing on a memo hit (#804, #824). The memo writes were capturing lambdas, which allocated a closure on every lookup.
    • PostgreSQL also remembers an unmapped type against the mapping registry's version, so enum and array lookups drop from about 470 ns and 950 B to about 10 ns and 0 B.
    • A mapping registered later still takes effect.
  • SQL Server's reserved-word check is a hash lookup for printable-ASCII names (#825, #828). SQL Server DDL generation goes from about 85 µs to about 2 µs per table, with every answer unchanged (pinned against the old implementation).
  • #805 (span formatting) was measured and closed as not applicable.

SQL Server

  • Update and rollback scripts re-run cleanly (#814, by @jovball):
    • column adds are guarded by COL_LENGTH
    • primary key and check constraint adds by OBJECT_ID
    • key-column NOT NULL alters by COLUMNPROPERTY
    • column, primary key and table type drops use IF EXISTS
  • Also from @jovball (#815):
    • A column type change that involves a default no longer fails, and can run twice.
    • The CREATE TABLE guard uses N'' and the 'U' type. This changes the create text, so UseSchemaFingerprinting re-stamps once.
    • The JSON index guard keys on the column, not the table.
    • Partition SPLIT RANGE / MERGE RANGE are guarded.

Fixes and dependencies

  • db-patch and db-dump create a missing output directory (#813, by @jovball). The same fix shipped on the 9.x line as 9.50.2.
  • Npgsql.NetTopologySuite 10.0.3, matching Npgsql 10.0.3 (#819). The Npgsql 11 move (#812) waits for Npgsql 11 to ship.
  • The Try* parameter-type lookups no longer throw for an unmapped generic, nullable or collection type on any provider (#826, #827). For example, SqlServerProvider.TryGetDbType(typeof(List<int>)) now returns null. PostgreSQL no longer overflows the stack on a self-enumerating type such as JToken.
  • Firebird: a CREATE OR ALTER that loses a race with "BLOB not found" is now retried like any other lost race (#829).

Full Changelog: v10.0.0-alpha.1...10.0.0-alpha.2