Skip to content

Weasel 9.31.1

Choose a tag to compare

@jeremydmiller jeremydmiller released this 09 Sep 11:17
· 78 commits to master since this release
21a96ee

One fix, and the release notes the 9.31 line never got.

A shared partition manager could be reloaded out from under a concurrent reader

#584, closing #583, raised from JasperFx/marten#5364.

ManagedListPartitions kept its tenant registry in a plain Dictionary that it mutated in place, and published it two ways that both hand out the live instance — Partitions returns a ReadOnlyDictionary, which wraps rather than copies, and IListPartitionManager.Partitions() is a lazy iterator over the same dictionary, the one ListPartitioning.Partitions() calls for DDL and delta calculation. InitializeAsync then Clear()ed and refilled that instance.

One manager instance is shared across every database in a store, so db-apply --parallel N over more than N databases has a late-starting worker reloading the registry while an earlier worker is still enumerating it. That surfaced as Collection was modified; enumeration operation may not execute out of DatabaseBase.assertValidIdentifiers — reported as 1 failure in 29 databases at --parallel 16.

The quieter failure is the one worth upgrading for. Clear()-then-refill also lets a reader observe an empty or partial partition set and generate a script, or compute a partition delta, against it, with nothing raised at all.

Both managers now publish an immutable snapshot and swap it copy-on-write. Weasel.SqlServer's ManagedTenantPartitions had the identical shape and gets the same treatment, which matters for Polecat.

This is latent rather than a recent regression — it is not caused by anything in 9.31.0.

Release notes for 9.31.0

9.31.0 shipped to NuGet without notes. The 9.31 upgrade guide now covers it, including two silent runtime behaviour changes that went out undocumented:

  • The ChangeTracker DeepEquals fallback is opt-in now (#578) — semantic JSON change detection is off unless you set IStorageSession.UseSemanticJsonChangeDetection. It matters if your documents carry dictionaries or sets that get rebuilt.
  • A member-valued flat-table decrement inserts the negated parameter (#574) — a first sighting of 5 on a row that does not exist yet now lands the column at -5.

Also in 9.31.0: JSON column reads stream instead of materializing a UTF-16 string (#576 — 20% fewer allocated bytes, Gen2 collections halved at 120 KB), a never-created stream is at version 0 rather than a conflict (#580), and a run of internals lifted out of Marten, Polecat and Fisher into Weasel.Storage and Weasel.Core.

Full notes: https://weasel.jasperfx.net/release-9-31