refactor(runtime): centralize placement compatibility caching - #10599
Merged
ReubenBond merged 2 commits intoAug 14, 2026
Merged
ReubenBond merged 2 commits into
ReubenBond merged 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8a704efe-ccce-454f-b619-0f873bcdcc1e
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes placement compatibility caching in CachedVersionSelectorManager so placement decisions are aligned with membership + cluster manifest publication generations, removing duplicated caching/invalidation logic from PlacementService.
Changes:
- Removed
PlacementService’s local compatible-silos cache/invalidation plumbing and delegated compatible-silo lookups toCachedVersionSelectorManager. - Simplified
CachedVersionSelectorManagerby requiringIClusterMembershipServiceand removing the temporaryCacheInvalidatedevent path. - Updated
PlacementServiceTeststo construct a realCachedVersionSelectorManager(with membership) and adjusted coverage for shutdown/membership/manifest scenarios.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Core.Tests/Runtime/PlacementServiceTests.cs | Updates test fixture to use membership-backed CachedVersionSelectorManager and adjusts/extends compatibility caching tests. |
| src/Orleans.Runtime/Versions/CachedVersionSelectorManager.cs | Requires IClusterMembershipService and removes the cache invalidation event shim. |
| src/Orleans.Runtime/Placement/PlacementService.cs | Removes duplicated compatibility cache and delegates compatibility queries to the selector manager. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
This was referenced Aug 14, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3afaf993-416a-46da-b8c3-8e44292d917f
This was referenced Aug 15, 2026
This was referenced Aug 28, 2026
Merged
This was referenced Aug 31, 2026
This was referenced Sep 7, 2026
Closed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PlacementService maintained a second compatibility cache and its own invalidation plumbing alongside CachedVersionSelectorManager. That duplication made placement compatibility state harder to reason about and risked the two caches observing membership and manifest publication at different points.
This change centralizes placement compatibility caching in CachedVersionSelectorManager. PlacementService now delegates compatible-silo lookups to the selector manager, while the selector preserves the retry yielding and cache-clearing behavior introduced by #10597 and removes the temporary CacheInvalidated event and legacy constructor shim.
This follows #10596 and #10597, consolidating ownership of compatibility cache state so placement decisions align with the published membership and grain manifest versions.
Microsoft Reviewers: Open in CodeFlow