Skip to content

Bump Marten to 9.7.3 (+ JasperFx 2.9.9) — fix tenant-partitioned composite catch-up under managed distribution - #3085

Closed
erdtsieck wants to merge 1 commit into
JasperFx:mainfrom
erdtsieck:bump-marten-9.7.3-partitioned-composite
Closed

erdtsieck wants to merge 1 commit into
JasperFx:mainfrom
erdtsieck:bump-marten-9.7.3-partitioned-composite

Conversation

@erdtsieck

Copy link
Copy Markdown
Contributor

What

Bump the pinned Marten 9.6.0 → 9.7.3 and JasperFx 2.8.2 → 2.9.9 (the version 9.7.3 depends on), and add a regression test for composite projection catch-up under UseWolverineManagedEventSubscriptionDistribution + Marten UseTenantPartitionedEvents.

Why

On the pinned Marten 9.6.0, a composite projection never catches up under the Wolverine-hosted daemon with tenant-partitioned events — it stays stuck at a premature 0 → 1 optimized rebuild, while a plain SingleStreamProjection in the same store catches up and Marten's own daemon handles the composite fine.

Root cause is not in Wolverine's distribution layer. Marten 9.6.0 predates marten#4712 (high-water Timestamp under tenant-partitioned events): the store-global HighWaterAgent reads a default(DateTimeOffset) = 0001-01-01 timestamp, computes a bogus safe-harbor (0001-01-01 + StaleSequenceThreshold), and never advances:

Starting single-pass composite rebuild for CsComposite:All over events 0 to 1
Shard 'CsPlain:All': Executed updates for Event range ... 0 to 30
Finished ... CsComposite:All, proceeding to normal, continuous operation
High Water agent is stale at 30 ... skipping gap to events marked after 01/01/0001 00:00:03
Daemon projection high water detection was not able to determine a safe harbor sequence, will try again soon   (forever)

Clean A/B, only the Marten version changed:

Marten Result
9.6.0 (current pin) hang ~90s, composite stuck at 1, stale … 01/01/0001
9.7.3 PASS in ~4s

The full wolverine.slnx builds clean against the bump (0 warnings / 0 errors).

Closes #3084. Supersedes #3083 (which assumed a Wolverine-layer bug).

…ite catch-up

The pinned Marten 9.6.0 predates marten#4712 (high-water Timestamp under
UseTenantPartitionedEvents). On 9.6.0 the store-global HighWaterAgent reads a
default 0001-01-01 timestamp, computes a bogus safe-harbor, and never advances,
so a composite projection stalls at its premature "0 to 1" optimized rebuild
under UseWolverineManagedEventSubscriptionDistribution while a plain projection
catches up. Marten 9.7.3 contains the fix and the scenario passes.

Adds a regression test covering composite catch-up under managed distribution +
tenant-partitioned events. Full wolverine.slnx builds clean against the bump.

Closes JasperFx#3084
Copilot AI review requested due to automatic review settings June 12, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a regression test to ensure composite projections catch up correctly under Wolverine-managed event subscription distribution when tenant-partitioned events are enabled, and updates Marten/JasperFx dependencies to versions containing the underlying high-water mark fix.

Changes:

  • Added a new regression test covering composite projection catch-up across multiple managed tenants with UseTenantPartitionedEvents.
  • Updated JasperFx packages to 2.9.9.
  • Updated Marten packages to 9.7.3.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Persistence/MartenTests/Distribution/composite_catches_up_under_managed_distribution_with_partitioning.cs Adds a regression test validating composite projections catch up for tenant-partitioned events under Wolverine-managed distribution.
Directory.Packages.props Bumps JasperFx and Marten package versions to pick up fixes needed by the regression scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +10
using JasperFx;
using JasperFx.CodeGeneration;
using JasperFx.Core;
using JasperFx.Events;
using JasperFx.Events.Projections;
for (var i = 0; i < StreamsPerTenant; i++)
{
var id = Guid.NewGuid();
session.Events.StartStream<CsTrip>(id, new TripStarted(id), new TripLeg(1.0), new TripLeg(2.5));
@erdtsieck

Copy link
Copy Markdown
Contributor Author

Note on the failing CI checks — unrelated to this bump

The red build and Run Marten Tests checks fail at restore, not in any test:

error NU1903: Warning As Error: Package 'MessagePack' 3.1.3 has a known high severity
vulnerability, https://github.com/advisories/GHSA-hv8m-jj95-wg3x

This is a newly-published advisory for MessagePack 3.1.3, which is pinned repo-wide in Directory.Packages.props and is not touched by this PR. With TreatWarningsAsErrors=true the NuGet audit warning becomes a build error. main's CI was green on 2026-06-11 and would now hit the same NU1903 if re-run, since the audit evaluates live advisory data at restore time — only the jobs that pull in Wolverine.MessagePack fail; every job that doesn't passes.

So the failures are orthogonal to the Marten 9.6.0 → 9.7.3 bump. Locally the full wolverine.slnx builds clean and the new test passes in ~4s with -p:NuGetAudit=false. Resolving the advisory (e.g. MessagePack 3.1.3 → 3.1.7) is a separate, repo-wide change and is intentionally left out of this PR.

jeremydmiller added a commit that referenced this pull request Jun 15, 2026
Bump Marten to 9.7.3 — fix tenant-partitioned composite catch-up (rebase of #3085)
@jeremydmiller

Copy link
Copy Markdown
Member

Rebased onto current main and merged via #3105 (your authorship preserved via cherry-pick). main was already at JasperFx 2.9.10, so only the Marten 9.6.0 → 9.7.3 bump and your regression test were carried over. Thank you @erdtsieck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composite projection stalls under UseTenantPartitionedEvents + managed distribution on the pinned Marten 9.6.0 (missing marten#4712)

3 participants