Skip to content

fix(runtime): preserve default directory with named distributed registration - #11553

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-named-directory-isolation
Oct 21, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-named-directory-isolation

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Problem

Registering a named distributed grain directory also replaced the legacy remote directory endpoints. Default-directory grains then used different authorities for local and remote registrations, allowing duplicate activations in a stable cluster. This regressed in #10050.

Solution

Make legacy remote endpoint ownership follow the configured default directory. The local directory retains its remote service and cache-validator endpoints when the distributed directory is named; the distributed directory installs its rolling-upgrade adapters during lifecycle participation when it is the default. Its client and partition endpoints continue serving named registrations.

Add a two-silo regression which explicitly disables the test harness's default directory, registers a default-directory grain from a non-owner silo, and then calls it from the directory owner. It compares physical activation addresses for both default-directory and named-directory grains, with a distributed-as-default control case.

Fixes #11512.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 21, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes consistently preserve default-directory ownership, with regression coverage and no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes #11512 by keeping legacy remote endpoints aligned with the default grain directory, preventing named distributed registration from causing duplicate activations.

Changes:

  • Preserve local directory endpoints when the distributed directory is named.
  • Register distributed compatibility endpoints during lifecycle participation only when it is the default.
  • Add two-silo activation-uniqueness coverage for named and default configurations.
File Description
test/​Orleans.GrainDirectory.Tests/​GrainDirectory/​NamedGrainDirectoryTests.cs Adds regression tests and a distributed-default control case.
src/​Orleans.Runtime/​GrainDirectory/​LocalGrainDirectory.cs Bases endpoint ownership on default-directory selection.
src/​Orleans.Runtime/​GrainDirectory/​DistributedRemoteGrainDirectory.cs Clarifies endpoint ownership in documentation.
src/​Orleans.Runtime/​GrainDirectory/​DistributedGrainDirectory.cs Conditionally registers compatibility endpoints during lifecycle participation.

Review effort: Balanced

@ReubenBond
ReubenBond merged commit 1255777 into dotnet:main Oct 21, 2026
91 checks passed
@ReubenBond
ReubenBond deleted the rb-named-directory-isolation branch October 21, 2026 16:45
ReubenBond added a commit to ReubenBond/orleans that referenced this pull request Oct 22, 2026
…tration (dotnet#11553)

(cherry picked from commit 1255777)

Upstream-PR: dotnet#11553
Upstream-Commit: 1255777
ReubenBond added a commit that referenced this pull request Oct 23, 2026
…tration (#11553)

(cherry picked from commit 1255777)

Upstream-PR: #11553
Upstream-Commit: 1255777
This was referenced Oct 29, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Named AddDistributedGrainDirectory(name) causes duplicate activations for grains using the default directory (regression in 10.2.0)

2 participants