Use membership versions for stale directory cleanup#10087
Merged
ReubenBond merged 2 commits intoMay 12, 2026
Conversation
This was referenced May 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Orleans runtime grain directory’s cleanup logic to use cluster membership snapshots/versions when deciding whether directory/cache entries are stale, aiming to avoid removing registrations for “unknown” silos when those registrations may be newer than the applied membership view.
Changes:
- Switched
LocalGrainDirectorymembership handling from silo-status events to consumingIClusterMembershipServicesnapshots and applying updates on the directory scheduler. - Updated local directory/cache cleanup to use a membership-version-aware predicate for entries whose silo is missing from the current snapshot.
- Simplified/adjusted directory handoff operation scheduling and moved directory-owner deactivation logic out of
CatalogintoLocalGrainDirectory.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Core.Tests/Directory/CachedGrainLocatorTests.cs | Updates test setup to provide a cluster membership service when constructing LocalGrainDirectory. |
| src/Orleans.Runtime/GrainDirectory/LocalGrainDirectory.cs | Processes membership snapshots, updates membership ring, and uses membership versions when deciding if unknown-silo entries are stale. |
| src/Orleans.Runtime/GrainDirectory/GrainDirectoryHandoffManager.cs | Adds additional successor validation, filters accepted registrations, and changes pending-operation scheduling behavior. |
| src/Orleans.Runtime/Catalog/Catalog.cs | Removes silo-status-change handling which has been moved into LocalGrainDirectory. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 4
737161c to
8d7d37d
Compare
Evict LocalGrainDirectory directory and cache entries for terminating silos immediately, and only evict unknown-silo entries when the address was registered before the applied membership snapshot. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8d7d37d to
a8ef248
Compare
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.
Part 2 of 7 split from #10085.
Problem:
Directory cleanup could remove registrations for silos which are absent from the current snapshot even when the registration was observed at the same or a newer membership version.
Solution:
Use the registration membership version to distinguish stale unknown-silo entries from entries which may be newer than the applied membership snapshot.
Stack:
Merge after #10086. This branch is stacked on split/pr10085-01-membership-reconcile; until #10086 merges, GitHub may show earlier stack changes in this PR. Incremental compare: ReubenBond/orleans@split/pr10085-01-membership-reconcile...split/pr10085-02-stale-version-cleanup
Review focus:
The stale-entry predicate for unknown silos and the point where LocalGrainDirectory removes directory/cache entries.