Add distributed remote grain directory compatibility#10050
Merged
ReubenBond merged 12 commits intoMay 8, 2026
Merged
Conversation
4f0f87c to
0a5f4a4
Compare
This was referenced Apr 29, 2026
7f1c458 to
223d182
Compare
8c1324b to
c78df19
Compare
c78df19 to
69a37ea
Compare
Member
Author
This was referenced Apr 29, 2026
69a37ea to
03dbb92
Compare
e1e53f4 to
4b26b7b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a compatibility layer so silos running the new DistributedGrainDirectory can continue to serve legacy IRemoteGrainDirectory requests during rolling upgrades from LocalGrainDirectory, alongside testing-host and test-suite updates to validate mixed-mode upgrade scenarios.
Changes:
- Add
DistributedRemoteGrainDirectorysystem targets backed byDistributedGrainDirectoryto handle legacy remote directory calls during rolling upgrades. - Add local-directory compatibility system targets (
IGrainDirectoryClient/IGrainDirectoryPartition) to enable mixed local/distributed interop. - Extend testing infrastructure and add/adjust tests to cover rolling upgrade and resilience behavior.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryRollingUpgradeTests.cs | New rolling-upgrade test exercising mixed Local→Distributed directory transitions with diagnostic log capture. |
| test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryResilienceTests.cs | Use runtime PartitionsPerSilo from DirectoryMembershipService for integrity checks. |
| src/Orleans.TestingHost/TestCluster.cs | Initialize client gateways from active silo gateway endpoints (fallback to configured ports). |
| src/Orleans.TestingHost/InProcTestClusterOptions.cs | Add UseTestClusterGrainDirectory option (internal) to allow opting out of the test grain directory. |
| src/Orleans.TestingHost/InProcTestClusterBuilder.cs | Default UseTestClusterGrainDirectory to true for backwards-compatible behavior. |
| src/Orleans.TestingHost/InProcTestCluster.cs | Conditionally register the test grain directory based on UseTestClusterGrainDirectory. |
| src/Orleans.Runtime/Hosting/CoreHostingExtensions.cs | Update distributed directory registration to construct DirectoryMembershipService with explicit partitioning/boundaries configuration. |
| src/Orleans.Runtime/GrainDirectory/RemoteGrainDirectory.cs | Add optional registerAsSystemTarget to avoid system target ID conflicts when distributed directory is active. |
| src/Orleans.Runtime/GrainDirectory/LocalGrainDirectoryCompatibility.cs | New compatibility system targets enabling distributed-directory silos to interact with local-directory silos. |
| src/Orleans.Runtime/GrainDirectory/LocalGrainDirectory.cs | Avoid registering local IRemoteGrainDirectory targets when distributed directory is active; register compatibility targets for local-mode silos. |
| src/Orleans.Runtime/GrainDirectory/GrainDirectoryHandoffManager.cs | Add additional rolling-upgrade diagnostic logging around split-partition handoff and removal. |
| src/Orleans.Runtime/GrainDirectory/DistributedRemoteGrainDirectory.cs | New distributed-backed IRemoteGrainDirectory implementation with batching, retries, and duplicate-activation cleanup. |
| src/Orleans.Runtime/GrainDirectory/DistributedGrainDirectory.cs | Use configured partitions-per-silo and register distributed-backed IRemoteGrainDirectory targets for upgrade compatibility. |
| src/Orleans.Runtime/GrainDirectory/DirectoryMembershipSnapshot.cs | Add default ring-boundary function matching LocalGrainDirectory and use it consistently (including for Default). |
| src/Orleans.Runtime/GrainDirectory/DirectoryMembershipService.cs | Parameterize membership snapshot generation by partitions-per-silo and boundary function. |
Copilot's findings
- Files reviewed: 15/15 changed files
- Comments generated: 2
e1618b4 to
b39d8b8
Compare
0780eca to
9fcee27
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add CancellationToken support and initialization guard to prevent DistributedRemoteGrainDirectory from blocking indefinitely when directory requests arrive before the first membership update. - Extract internal LookupAsync, RegisterAsync, UnregisterAsync methods with CancellationToken support on DistributedGrainDirectory - Add EnsureDirectoryInitializedAsync to refresh membership view before processing requests from legacy silos - Add 30-second timeout to all IRemoteGrainDirectory operations - Pass DirectoryMembershipService to DistributedRemoteGrainDirectory - Simplify rolling upgrade test assertions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore queued split-partition handoff semantics for local-to-distributed upgrades, add compatibility targets on local silos for distributed recovery APIs, refresh test-cluster gateways from active silos, and harden the rolling-upgrade regression test diagnostics and client refresh path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9fcee27 to
e09534f
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.
Summary
Adds the distributed remote grain directory compatibility path on top of #10047 so distributed-directory silos can serve legacy
IRemoteGrainDirectoryrequests during rolling upgrades from the local grain directory.Changes
DistributedRemoteGrainDirectorybacked byDistributedGrainDirectory.Stack notes
This branch is rebased on top of #10047. The focused review range is:
fix/directory-snapshot-transfer-ranges..feature/distributed-remote-grain-directoryFollow-on PRs:
Validation
Focused validation run locally:
dotnet test test\Orleans.GrainDirectory.Tests\Orleans.GrainDirectory.Tests.csproj --framework net10.0 --filter "FullyQualifiedName~GrainDirectoryRollingUpgradeTests|FullyQualifiedName~GrainDirectoryPartitionBatchingTests|FullyQualifiedName~GrainDirectoryResilienceTests.JoiningSilo_DoesNotLeaveStaleEntriesOnPreviousOwner" -- -parallel none -noshadowGrainDirectoryResilienceTests.ElasticChaoswas also attempted in a broader run and timed out; the deterministic non-chaos coverage above passed.