Repository navigation
GH-5098 Event subscription capabilities match tenant-neutrally - #5102
Merged
Merged
Conversation
A node captures its capabilities once at startup. Under per-tenant event partitioning, a node that
started before a tenant was added still advertises the store-global agent (or the old tenants), and
a node that started after advertises the per-tenant agents. Exact-URI matching made the two look like
different releases, so AllNodesHaveSameCapabilities went false and the capability-matching
(blue/green) path placed every new tenant's agents only on the newer nodes.
Tenants are data, not code. A node that can run a store's .../{shard} agent can run
.../{shard}/{tenant} for any tenant of that store.
- EventSubscriptionAgentFamily.CapabilityKeyOf: the TenantNeutralKeyOf of an event-subscriptions URI,
null for any other scheme.
- AssignmentGrid.Node.Declares also matches an event subscription agent by that key, so candidate
matching, TryAssign and the undeclared-assignment warning agree.
- AllNodesHaveSameCapabilities compares event subscription capabilities by that key.
- The stalled-agent release counts a peer that declares the same shard for another tenant.
A new projection, or a new version of one, still changes the key, so blue/green is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
This was referenced Oct 21, 2026
This was referenced Nov 1, 2026
This was referenced Nov 9, 2026
This was referenced Nov 16, 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.
Problem
A node captures its agent capabilities once at startup. Under
UseTenantPartitionedEvents, a node that started before a tenant was added still advertises the store-global agent or the old tenants. A node that started after advertises the per-tenant agents.Exact-URI matching made those two nodes look like different releases.
AllNodesHaveSameCapabilitieswent false, and the capability-matching (blue/green) path placed every new tenant's agents only on the newer nodes. CritterWatch #1431's two-node harness showed all four tenant agents on node 2 and nothing on node 1, depending on timing.Fix
This is option 2 from the issue. Tenants are data, not code, so event subscription capabilities now match tenant-neutrally:
EventSubscriptionAgentFamily.CapabilityKeyOfreturns the existingTenantNeutralKeyOffor anevent-subscriptions://URI, and null for any other scheme.AssignmentGrid.Node.Declaresalso matches an event subscription agent by that key. Candidate matching,TryAssignand the undeclared-assignment warning all go through it.AllNodesHaveSameCapabilitiescompares event subscription capabilities by that key.A new projection, or a new version of one, still changes the key, so blue/green behaviour is unchanged. Other agent schemes compare exactly as before.
Tests
CoreTests
tenant_neutral_event_subscription_capabilities_5098covers:Results:
CoreTests.Runtime.Agentspass../build.sh CIMartenDistribution --framework net9.0: 230 passed, 0 retries.dotnet build wolverine.slnx -c Release -f net9.0has 0 errors.Closes #5098
🤖 Generated with Claude Code
https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U