GH-4562: cover the blue/green partial-grandfather placement on Polecat - #4576
Merged
Merged
Conversation
Polecat registers the same EventSubscriptionAgentFamily as Marten and runs through the identical DistributeByGroupAffinity, but PolecatTests had no analogue of MartenTests' blue_green_version_bump_assignment. This adds one, built on agent URIs two real Polecat stores advertise rather than hand-written ones, so it also covers Polecat's own shard-identity and versioning grammar feeding the placement. It is a structural twin rather than a copy. The Marten version gets a group deep enough to split from several tenants sharing a shard database; Polecat.Storage.SeparateDatabaseTenancy offers only AddTenant, so Polecat multi-tenancy is one tenant per database and cannot express that. The depth comes from several projections on one database instead, which leaves the mechanism under test unchanged: a partition holding more than one agent, of which a blue node runs some without declaring them. Single-database on purpose. A multi-tenanted Polecat store reports Cardinality = Single with an empty Databases collection from TryCreateUsage(), while IEventStore.AllDatabases() on that same store returns every tenant database (JasperFx/polecat#675). EventStoreAgents.SupportedAgentsAsync reads the usage descriptor, so every agent collapses onto the main database and there is nothing left to group. Worth revisiting as the full multi-database twin once that is fixed. Red on main's per-partition predicate -- trip/all/v2 is assigned to the blue node, which cannot build it -- and green on the per-member one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 24, 2026
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.
Follow-up to #4563 (GH-4562), which fixed group-affinity grandfathering so a node running part of a capability partition no longer becomes a candidate for the members it can neither declare nor run.
Polecat registers the same
EventSubscriptionAgentFamilyas Marten and runs through the identicalDistributeByGroupAffinity, butPolecatTestshad no analogue ofMartenTests.MultiTenancy.blue_green_version_bump_assignment. This adds one.What it covers
A blue/green rollout placed through the real agent family and the real grid, over agent URIs that two real Polecat stores advertise rather than hand-written ones — so it also covers Polecat's own shard-identity and versioning grammar feeding the placement, not just the grid arithmetic.
Blue serves
tripv1 +day. Green servestripv2 +day+distance, wheredistanceis registered on green only and blue is running it without declaring it. That is the Polecat stand-in for the tenant provisioned after the blue nodes captured their capability snapshots, and it is what used to pull blue into the candidate set for a partition it could only partly run.event-subscriptions://sqlserver/main/…/trip/all/v2is assigned to the blue node, which cannot build it.main.Why it is a structural twin, not a copy
The Marten version gets a group deep enough to split from several tenants sharing one shard database. Polecat cannot express that —
Polecat.Storage.SeparateDatabaseTenancyoffers onlyAddTenant, so Polecat multi-tenancy is one tenant per database. The depth here comes from several projections on one database instead. The mechanism under test is unchanged: a partition holding more than one agent, of which a blue node runs some without declaring them.Why it is single-database
A multi-tenanted Polecat store reports
Cardinality = Singlewith an emptyDatabasescollection fromTryCreateUsage(), whileIEventStore.AllDatabases()on that same store returns every tenant database — filed upstream as JasperFx/polecat#675.EventStoreAgents.SupportedAgentsAsyncreads the usage descriptor, so every agent collapses onto the main database and there is nothing left to group.Using one database keeps this test about placement rather than about that gap. The test comment says so and points at #675; when that is fixed, this is worth revisiting as the full multi-database twin of the Marten version.
Fisher
Deliberately not covered.
Wolverine.Fishercontains no reference toEventSubscriptionAgentFamilyat all and never reaches this code path — by design, per the note inWolverineOptionsFisherExtensions: distributing subscriptions presupposes several nodes sharing one event store, and a Fisher store is a single SQLite file. A group-affinity test there would assert nothing.Verification
PolecatTests.Distributiongreen (9 passed, 2 skipped), andwolverine.slnxbuilds clean in Release onnet9.0with no warnings.🤖 Generated with Claude Code