Repository navigation
DistributesAgentsPerTenant for sharded + per-tenant-partitioned stores (JasperFx 2.20.0) - #4856
Merged
Merged
Conversation
…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>
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.
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
IEventStore.DistributesAgentsPerTenant(JasperFx 2.20.0, Remove IEventStore.FetchAll() in favor of the new Linq support #487) onDocumentStore:trueonly forMultiTenantedWithShardedDatabases+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.StartAgentAsync(tenant ceilings primed before start —SubscribeFromPresentsubscriptions no longer rewind to sequence 0 and replay tenant history; exact-identity precedence; loud failure for tenant identities on non-partitioned stores).Tests
Regressions/per_tenant_agent_start_routes_high_water— restored from Per-tenant agent distribution, database-affine assignment + order-preserving streaming bulk import (wolverine#3280, #4806) #4799: deterministic repro that an individually-started per-tenant agent (the Wolverine distribution path) is routed its own tenant's high water instead of idling at 0 after the store-global mark has gone stable. Behaviorally pins the Remove IEventStore.FetchAll() in favor of the new Linq support #487 daemon fix through Marten.Config/distributes_agents_per_tenant_gating— the flag istrueonly for sharded + partitioned;falsefor single-database partitioned, sharded-without-partitioning, and defaults.TenantPartitionedEventsTests: 197/197 on net10.0 and net9.0 (run one TFM at a time), resolved against the published JasperFx 2.20.0.Note: deliberately no
UseDatabaseAffineAgentAssignmentoption from the original #4799 — database-affine agent grouping needs no Marten surface; Wolverine derives it per store from the existingIEventStore.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