Skip to content

DistributesAgentsPerTenant for sharded + per-tenant-partitioned stores (JasperFx 2.20.0) - #4856

Merged
jeremydmiller merged 3 commits into
masterfrom
feat/distributes-agents-per-tenant
Jul 6, 2026
Merged

jeremydmiller merged 3 commits into
masterfrom
feat/distributes-agents-per-tenant

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Second split from #4799 (closed; first split was #4847, merged) — original work by @erdtsieck, carried with authorship intact. Part of the per-tenant event partitioning epic JasperFx/jasperfx#486.

What it does

  • Overrides the new IEventStore.DistributesAgentsPerTenant (JasperFx 2.20.0, Remove IEventStore.FetchAll() in favor of the new Linq support #487) on DocumentStore: true only for MultiTenantedWithShardedDatabases + UseTenantPartitionedEvents — the topology where multiple tenants co-located in one shard database draw independent, overlapping event sequences, so a node-distributed daemon host (Wolverine-managed distribution) must fan out one subscription agent per (shard, tenant) rather than one store-global agent per (shard, database). Fixes the wolverine#3280 data-loss shape at the contract level: a single store-global high water cannot track overlapping per-tenant sequences, so a lagging tenant's later appends fell below it and were skipped.
  • Consumes JasperFx 2.20.0, which also carries the hardened per-tenant StartAgentAsync (tenant ceilings primed before start — SubscribeFromPresent subscriptions no longer rewind to sequence 0 and replay tenant history; exact-identity precedence; loud failure for tenant identities on non-partitioned stores).

Tests

Note: deliberately no UseDatabaseAffineAgentAssignment option from the original #4799 — database-affine agent grouping needs no Marten surface; Wolverine derives it per store from the existing IEventStore.DatabaseCardinality.

Next in the train: the Wolverine successor to wolverine#3281 (per-tenant fan-out + always-on per-store database-affine assignment), which consumes this.

🤖 Generated with Claude Code

erdtsieck and others added 3 commits July 6, 2026 13:45
…ed stores

Overrides IEventStore.DistributesAgentsPerTenant => UseTenantPartitionedEvents &&
Tenancy is ShardedTenancy, so Wolverine-managed distribution fans out per-tenant
agents only where tenants are co-located in a shard DB with independent sequences.
Single-DB partitioning and database-per-tenant stay one agent per database.
See JasperFx/wolverine#3280.
…ting

Restores the regression test from #4799. per_tenant_agent_start_routes_high_water
reproduces the Wolverine-managed shape (StartAgentAsync per tenant shard, no
following store-global high-water tick) and requires the hardened per-tenant
StartAgentAsync from #487. distributes_agents_per_tenant_gating extracts
the DistributesAgentsPerTenant assertions from the archived affine-gating tests,
adjusted to compile without the dropped database-affine surface
(GroupAgentAssignmentsByDatabase / UseDatabaseAffineAgentAssignment /
MaxNodesPerDatabaseForAgents).

Co-Authored-By: Anne Erdtsieck <anne.erdtsieck@topicus.nl>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit a363b9f into master Jul 6, 2026
9 checks passed
@jeremydmiller
jeremydmiller deleted the feat/distributes-agents-per-tenant branch July 6, 2026 19:14
jeremydmiller added a commit that referenced this pull request Jul 6, 2026
#4856; epic #486)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants