chore: Bump Marten from 8.37.4 to 9.22.5 - #593
Closed
dependabot[bot] wants to merge 1 commit into
Closed
Conversation
--- updated-dependencies: - dependency-name: Marten dependency-version: 9.22.5 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Marten dependency-version: 9.22.5 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Marten dependency-version: 9.22.5 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Contributor
Author
|
Superseded by #596. |
dependabot
Bot
deleted the
dependabot/nuget/Nexus.Application/multi-c8a11d53bb
branch
August 7, 2026 09:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated Marten from 8.37.4 to 9.22.5.
Release notes
Sourced from Marten's releases.
9.22.5
Two source-generator and test-harness fixes that both surfaced on projections built through
AddProjectionWithServices, plus the JasperFx 2.42.2 adoption they ride on.Fixes
The source generator no longer breaks a projection that takes dependencies (#5192)
The bundled
JasperFx.Events.SourceGeneratorregisters anEventProjection's discovered published document types (#4166) by writing into your partial class. It used to emit a parameterless constructor to do it, which failed two ways for exactly the projections that need dependencies injected.It broke the build outright against a primary constructor. C# requires every other constructor to chain through the primary one, so this failed with CS8862 inside the generated
<T>.TypeRegistration.g.cs:And where it did compile, it silently did nothing. A projection registered through
AddProjectionWithServicesis built by the container, which calls the dependency-taking constructor — so the generated parameterless one never ran and the published types went unregistered. That also left the projection's teardown targets unregistered, so a rebuild did not wipe its documents.Registration now rides an override of
ProjectionBase.PublishedTypes(), which does not care how the instance was constructed.Affects 9.22.3 and 9.22.4. Earlier versions discovered published types syntactically, so only an explicit
ops.Store<Doc>(x)produced a registration and the far more commonops.Store(x)produced none — which meant the constructor was rarely emitted at all.One behavior change to be aware of: the generator used to skip registration entirely when your class already had an explicit parameterless constructor, a guard that existed only because you cannot add a second one. An override has no such conflict, so those projections now get their published types registered too. That is the intended #4166 behavior, but on upgrade it can newly provision document storage — and newly register teardown targets — for a projection that was quietly getting neither. If a projection writes into storage that must not be truncated on rebuild, set
DeletePublishedTypesOnTeardown = false.EventProjectionScenariono longer spends its wall clock asleep (#5195, in part)Almost none of a scenario's time was work. The harness wipes the event store and then starts the daemon, so the high-water agent's first look saw an empty store, read
CaughtUp, and settled intoSlowPollingTime— one second by default. Every append then raced a sleeping agent, and because the agent returns toCaughtUpafter each batch drains, the cost recurred at every batch boundary. Since a boundary is how a scenario says "these appends must land in different daemon batches", the more precisely a test described its batching, the slower it got.A scenario owns both the appends and the daemon that must notice them, so it now says so directly, through an in-process
IDaemonWakeup— a semaphore release, no database round trip and no LISTEN/NOTIFY. Nothing about your store's polling configuration changes.A flat ~250ms per boundary remains, from a hard-coded poll delay in
WaitForNonStaleDataAsync. That is the other half of #5195 and is still open.Dependencies
JasperFx / JasperFx.Events 2.42.2. Adopting it also enrolls Marten in the strong-typed identity event-sourcing compliance suite that landed in 2.42.0 (
IComplianceStoreRegistrar.RegisterValueType<T>()), taking the shared cross-store suite to 167 passing tests against Marten.9.22.4
What's Changed
Full Changelog: JasperFx/marten@V9.22.3...V9.22.4
9.22.3
What's Changed
Full Changelog: JasperFx/marten@V9.22.1...V9.22.3
9.22.1
Security release. Upgrade is recommended for anyone using sharded tenancy together with
Events.UseTenantPartitionedEvents.A tenant id was interpolated into a double-quoted PostgreSQL identifier without doubling an embedded double quote, so a tenant id containing one could terminate the identifier and execute additional SQL statements. This is a different class from the two advisories previously published on this repository, both of which were the single-quoted string-literal class; neither of those fixes addressed this.
You are affected only if you use sharded tenancy, have
UseTenantPartitionedEventsenabled, and your application passes attacker-influenced input as a tenant id. Note that the reachable surface includes ordinary session resolution, not just administrative provisioning calls —GetTenantAsync/FindOrCreateDatabaseauto-provision an unknown tenant. Applications using tenant ids from a trusted fixed set are not exploitable.Affected versions: 9.4.0 through 9.22.0.
Full details, including remediation guidance for existing data, are in the security advisory: GHSA-3vp4-34pf-2rcw
What changed
PerTenantEventSequences.QuotedSequenceNameescapes embedded quotes, matchingquote_ident/%Iso the name still resolves to the same object the quick-append function finds. Covers the create, drop, schema-apply and cleanup paths.BulkEventAppenderno longer builds an unquoted sequence name from a suffix read back out of the tenants table. This also fixes a functional bug:PreserveSourceSequencebulk imports previously failed with42601for hyphenated and GUID tenant ids under sharded tenancy.ShardedTenancyvalidates tenant ids destined for DDL, closing a long-standing asymmetry with theDefaultTenancyprovisioning path. It is a narrow denylist rather than the existing identifier allowlist, so hyphenated and GUID tenant ids keep working.Dependency
Requires Weasel.Postgresql 9.21.1, which escapes partition bound values (JasperFx/weasel#416). Both halves are needed; the dependency is pulled in automatically.
Credit to Barak Srour (Apiiro) for the report.
9.22.0
The partitioning feature is new, but otherwise this was all about CritterWatch improvements for a huge installation
What's Changed
Full Changelog: JasperFx/marten@V9.21.0...V9.22.0
9.21.0
Highlights
A small, low-risk release: two bug fixes reported against 9.20.x, a LINQ ordering fix, a Newtonsoft serialization fix, and a new health-check overload for Wolverine-managed daemon distribution.
Bug Fixes
mt_quick_append_eventsreturned{NULL}for an empty event array (#5062, #5088)array_length('{}', 1)isNULLin PostgreSQL rather than0, so calling the bulk append function with no events returned abigint[]whose single element wasNULL. Npgsql could not read that intolong[], and the resultingInvalidCastExceptionwas thrown from the batch's post-processing loop — where it displaced whatever exception had actually made the append fail. Callers were left with an unrelated, non-retryable error instead of the real one; for the reporter that dead-lettered Wolverine messages which would otherwise have been retried.Fixed on three fronts:
COALESCEs the array length, so an empty append means what it says: zero events appended, final version unchanged.ProjectionUpdateBatch.WaitForCompletion, for anAppendside effect that ended up with no events) no longer issues the call.OrderByagainst a dictionary indexer dropped the key (#5063, #5073)OrderBy(x => x.SomeDictionary["key"])generated SQL that ignored the indexer key, so the ordering was wrong (or arbitrary) rather than failing loudly.Lazy LINQ sequences serialized as objects under Newtonsoft (#5076, #5080)
A document property holding a deferred-execution sequence (
Select(...),Where(...)without a materializing call) was written by Newtonsoft as an iterator object rather than a JSON array, so it would not round-trip. These are now written as plain arrays.IMessageBatchis called concurrently (#5065, #5085)Not a behavior change, but a documentation fix worth flagging if you implement
IMessageBatchyourself: the async daemon raises projection side effects from multiple threads at once (measured at up to 8 concurrent publishers across 10 threads for a single-stream projection catching up). The interface previously said nothing about this. An implementation that appends to an unsynchronized collection will silently drop messages — the same hazard, in a real outbox, that showed up here as a "flaky" test.New
Provider-aware
databaseFilterfor the high-water health check (#5061, #5089)AddMartenHighWaterHealthCheck'sdatabaseFilteris captured at registration time, so it cannot resolve services — which makes it unable to express "the databases this node currently owns" when ownership is runtime state. That is precisely the case under Wolverine-managed daemon distribution, where agents are assigned per (database, tenant) and rebalanced over a node's lifetime.There is now an overload whose filter receives the
IServiceProviderand is re-evaluated on every probe:A subclass shares its parent's table, so the parent's column-backed members (duplicated fields, the id, the soft-delete flag) are now inherited by the subclass's query member resolution. Querying the parent type was already correct and is unchanged.
Event store, partitioning & daemon
UseTenantPartitionedEvents. Registering a tenant whose partition suffix contains a-(so every GUID tenant id) madeApplyAllConfiguredChangesToDatabaseAsync()throw42601because the per-tenantCREATE SEQUENCE/DROP SEQUENCEDDL emitted the identifier unquoted. The schema-apply statements are now quoted (matching the quick-append function and the imperative provisioning path), so hyphenated tenants migrate cleanly. Quote — not sanitize — so the append function can still resolve the sequence by its raw suffix.ObjectDisposedExceptionpath latches-and-rethrows so a HotCold cold node's leadership loop terminates instead of re-polling a disposed data source during shutdown.UseTenantPartitionedEventsthe store-global high-water agent was continuously runningselect max(seq_id) from mt_events, an unfiltered scan that fans out across every tenant partition on every poll. That store-global mark is not used to advance tenant projections (they advance per-tenant), so the recurring scan is now skipped under partitioning; tenant high water is driven by the per-tenant coordinator and poll timer.GetProjectionStatusesAsyncnow resolves the correct named database.AoT / trimming
AddEventType/QueryRawEventDataOnlygeneric-constraint tightening was reversed, and event-mapping construction now routes through the cachedGenericFactoryCachewhile preserving the trimming root (#4930).Dependencies
ShardState.DatabaseIdentifier(jasperfx#501).Closed issues
#4913, #4915, #4916, #4917, #4924, and jasperfx#502.
9.14.0
Marten 9.14.0 is the recommended upgrade for all 9.x users. It combines the LINQ SQL-injection security fix (first shipped in 9.13.0) with the fix for the projection-coordinator shutdown race in #4874 and the accompanying dependency updates.
Beyond the LINQ updates, this made the new Per-Tenant Event Partitioning much more robust as we're testing that in conjunction with a JasperFx client for ludicrous scalability.
🔒 Security — SQL injection in the LINQ provider (GHSA-rfx3-98h7-v3xp)
Several LINQ / tenant-management code paths interpolated a runtime, potentially attacker-influenced value into generated SQL as a single-quoted literal without escaping or parameterization. A value containing a single quote could break out of the literal and inject SQL. The primary vector — a
Dictionary<,>indexer key in aWherefilter (a common "filter by attribute name" / EAV pattern) — was reported privately with an executed proof-of-concept and enabled filter / multi-tenant authorization bypass and blind data exfiltration.Fixed sinks (#4911):
DictionaryItemMember— dictionary indexer key, e.g.Where(x => x.Attributes[key] == v)DictionaryContainsKeyFilter—Dictionary.ContainsKey(key)(Newtonsoft serializer + the Enum branch, which bypass System.Text.Json's quote escaping)SelectParser— a constant string projected throughSelect(x => new { L = runtimeString })DeleteAllForTenant— tenant id reaching per-tenant projection teardown (now parameterized)DatabaseScopedTenantPartitions— tenant id inlined into partition DDLEventLoader— per-tenant partition-pruning literal (defense-in-depth)Each sink now escapes embedded single quotes or binds the value as a parameter; regression tests lock down every vector, and a follow-up LINQ-wide audit cleared the rest of the query hot path (full-text search, string-method translations, comparisons,
IsOneOf/Contains/subset operators, and patching paths). Affected versions: 7.0.0 – 9.12.0. Also patched in 8.37.4 (8.x line) and 9.13.0.Reported responsibly by @svenclaesson — thank you. See advisory GHSA-rfx3-98h7-v3xp (CVE pending assignment).
🛠️ Reliability — projection-coordinator shutdown drain race (#4874)
On host shutdown, the native HotCold projection coordinator could abort with
ObjectDisposedException: 'Npgsql.PoolingDataSource'— the coordinator's leadership poll issued anOpenAsyncagainst an already-disposed data source while tenancy was tearing down. This is the "case B" ordering storm reported against #4874 (distinct from the async-tenancy foundation laid in #4907, which did not resolve it).The fix ships through the dependency updates below, with a Marten-side regression test (
Bug_4874_coordinator_drain_ordering, #4912):ProjectionCoordinatorBaseterminates the leadership loop on a disposed data source / wrapped cancellation instead of re-polling.AdvisoryLockguards against a disposedNpgsqlDataSourceduring shutdown (short-circuits while disposing and treats a disposed-poolObjectDisposedExceptionas a non-acquire rather than propagating).⬆️ Dependency updates
Full changelog since 9.13.0
9.13.0
Security release. Fixes SQL injection in the LINQ provider via unescaped string literals (#4911).
Several LINQ / tenant-management code paths interpolated a runtime, potentially attacker-influenced value into generated SQL as a single-quoted literal without escaping or parameterization; a value containing a single quote could break out and inject SQL. The primary vector — a
Dictionary<,>indexer key in aWherefilter — was reported privately with an executed proof-of-concept (filter / multi-tenant authorization bypass, blind exfiltration).Fixed sinks:
DictionaryItemMember— dictionary indexer keyDictionaryContainsKeyFilter—ContainsKeykey (Newtonsoft serializer + Enum branch)SelectParser— constant string projected viaSelect(...)DeleteAllForTenant— tenant id in per-tenant projection teardown (now parameterized)DatabaseScopedTenantPartitions— tenant id in partition DDLEventLoader— per-tenant partition-pruning literal (defense-in-depth)All 9.x users should upgrade. The 8.x line is fixed in 8.37.4. See advisory GHSA-rfx3-98h7-v3xp.
9.12.0
A couple significant bug fixes, and yet more support for CritterWatch
What's Changed
Full Changelog: JasperFx/marten@V9.11.0...V9.12.0
9.11.0
What's Changed
Full Changelog: JasperFx/marten@V9.10.0...V9.11.0
9.10.0
The new option might help the async daemon perform better in the face of concurrency exceptions on event appending with the QuickAppend option. It's opt in to avoid folks needing to do schema migrations
What's Changed
New Contributors
Full Changelog: JasperFx/marten@V9.9.1...V9.10.0
9.9.1
This will be a valuable upgrade for anyone who experiences a high degree of optimistic concurrency failures while using QuickAppend options, which is the default behavior in V9. This will help stop gaps in the event sequence, which in turn will make the Async Daemon healthier.
Also though, see Wolverine for help in preventing concurrent access in the first place
What's Changed
Full Changelog: JasperFx/marten@V9.9.0...V9.9.1
9.9.0
What's Changed
Full Changelog: JasperFx/marten@V9.8.2...V9.9.0
9.8.2
Couple bug reports related to the Daemon, one performance related for folks using the archived partitioning on the event store
What's Changed
Full Changelog: JasperFx/marten@V9.8.1...V9.8.2
9.8.1
This might impact folks migrating from Marten 8 to Marten 9. Strictly an issue with database migrations
What's Changed
Full Changelog: JasperFx/marten@V9.8.0...V9.8.1
9.8.0
This was pretty well 100% about CritterWatch. The new APIs are all to support CritterWatch
What's Changed
Full Changelog: JasperFx/marten@V9.7.5...V9.8.0
9.7.5
What's Changed
Full Changelog: JasperFx/marten@V9.7.4...V9.7.5
9.7.4
What's Changed
Full Changelog: JasperFx/marten@V9.7.3...V9.7.4
9.7.3
Small release. Couple fixes for daemon resiliency and CritterWatch administration actions
What's Changed
Full Changelog: JasperFx/marten@V9.7.2...V9.7.3
9.7.2
What's Changed
Full Changelog: JasperFx/marten@V9.7.1...V9.7.2
9.7.1
What's Changed
Full Changelog: JasperFx/marten@V9.7.0...V9.7.1
9.7.0
There's a few bug fixes, and the new functionality is really for CritterWatch.
What's Changed
Full Changelog: JasperFx/marten@V9.6.0...V9.7.0
9.6.0
There's a couple tenant aware APIs that are new, so this had to be a minor point bump. The majority of the work in this release was stress testing projection rebuilds and ensuring there was never any concurrent access of un-thread safe dictionaries inside of the async daemon that happened as a side effect of 9.0 changes.
What's Changed
Full Changelog: JasperFx/marten@V9.5.3...V9.6.0
9.5.3
This is a little optimization to the new 9.* code that eliminated the runtime codegen, and a fix for the daemon being a little vulnerable to concurrency in its internals -- which is also an optimization here.
What's Changed
Full Changelog: JasperFx/marten@9.5.2...V9.5.3
9.5.2
Bug fixes
mt_archive_streamemits explicit column lists in its INSERT…SELECT, survivingALTER TABLE ADD COLUMNmigrations that reorder the physical column layout (previously failed with42804after a column was added tomt_events).BulkInsertEventsAsyncwritesmt_streams.typefrom theStreamAction'sAggregateType, restoringUseMandatoryStreamTypeDeclarationsupport on the bulk path.AddMartenManagedTenantsAsyncno longer leaves a half-installed schema underAutoCreate.None. The admin call eagerly applies the events feature via a per-featureCreateMigrationAsync+ scopedCreateOrUpdateapply, so the next append succeeds end-to-end on a virgin schema (previously failed with42P01/42883).e.tenant_id = t.tenant_id, eliminating own-event duplication under per-tenant sequences withUseTenantPartitionedEvents.Test coverage
TenantPartitionedEventsTestsproject (~170 tests across 50 files) covering append / read / projections / admin / DCB / async daemon / regressions underUseTenantPartitionedEvents.Description has been truncated