Skip to content

fix: exclude non-Active silos from placement - #10219

Merged
ReubenBond merged 24 commits into
dotnet:mainfrom
ReubenBond:reubenbond/active-silo-placement
Jun 15, 2026
Merged

ReubenBond merged 24 commits into
dotnet:mainfrom
ReubenBond:reubenbond/active-silo-placement

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Fixes placement eligibility so compatible silo candidates come from active membership/manifest state by construction. GetCompatibleSilos continues to return SiloAddress[] and uses the cached active-silo list from ISiloStatusOracle.GetActiveSilos() for homogeneous test-mode candidates while preserving deferred placement-filter materialization.

@ReubenBond
ReubenBond force-pushed the reubenbond/active-silo-placement branch 3 times, most recently from cdef309 to 9bb75b5 Compare June 13, 2026 17:54
@ReubenBond
ReubenBond requested a review from Copilot June 13, 2026 17:55

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.

Pull request overview

This PR updates Orleans placement and cluster-manifest handling so that placement candidates/manifests better reflect current cluster availability (notably around shutdown/termination), while also tightening APIs and reducing manifest duplication.

Changes:

  • Update IPlacementContext.GetCompatibleSilos to return ImmutableArray<SiloAddress> and adjust placement directors/tests to match.
  • Update PlacementService to use ISiloStatusOracle.GetActiveSilos() for active-silo filtering and filter versioned compatible-silo results by active membership.
  • Improve cluster manifest behavior (sync pruning of non-active silos, manifest publishing behavior, manifest deduplication) and add new targeted tests.
Show a summary per file
File Description
test/Orleans.Core.Tests/Runtime/PlacementServiceTests.cs Adds coverage for excluding local silo during shutdown; updates test scaffolding for GetActiveSilos()/ImmutableArray.
test/Orleans.Core.Tests/Runtime/LocalPlacementDirectorTests.cs Updates mocks to return ImmutableArray from GetCompatibleSilos.
test/Orleans.Core.Tests/Runtime/ActivationCountPlacementDirectorTests.cs Updates mocks to return ImmutableArray from GetCompatibleSilos.
test/Orleans.Core.Tests/Manifest/ClusterManifestProviderTests.cs New tests validating manifest pruning/publishing behavior and placement’s active-only results.
test/Orleans.Core.Tests/Manifest/ClusterManifestDeduplicationTests.cs New tests validating structural equality/deduplication of manifest objects.
test/Grains/TestGrains/VersionAwarePlacementDirector.cs Adjusts to treat compatible silos as IReadOnlyList for ImmutableArray compatibility.
src/Orleans.Runtime/Versions/CachedVersionSelectorManager.cs Switches cached suitable-silos list to ImmutableArray.
src/Orleans.Runtime/Placement/SiloRoleBasedPlacementDirector.cs Uses ImmutableArray for compatible-silo list and IsEmpty checks.
src/Orleans.Runtime/Placement/PlacementService.cs Changes compatible-silo API to ImmutableArray, uses GetActiveSilos(), and filters versioned results by actives.
src/Orleans.Runtime/Placement/ActivationCountPlacementDirector.cs Updates selector helper signature to accept ImmutableArray.
src/Orleans.Runtime/Manifest/ClusterManifestProvider.cs Refactors manifest synchronization/publishing and membership-update processing; now depends on IClusterMembershipService.
src/Orleans.Core/Placement/IPlacementDirector.cs Updates placement hint helper signature to accept ImmutableArray.
src/Orleans.Core/Placement/IPlacementContext.cs Updates placement context API to return ImmutableArray.
src/Orleans.Core/Manifest/GrainBindings.cs Small refactor to centralize manifest processing loop into a local function.
src/Orleans.Core/Core/GrainInterfaceTypeToGrainTypeResolver.cs Refactor to centralize per-manifest cache building logic into a helper method.
src/Orleans.Core.Abstractions/Manifest/GrainProperties.cs Adds structural equality/hash support for deduplication.
src/Orleans.Core.Abstractions/Manifest/GrainManifest.cs Adds structural equality/hash support for deduplication.
src/Orleans.Core.Abstractions/Manifest/GrainInterfaceProperties.cs Adds structural equality/hash support for deduplication.
src/Orleans.Core.Abstractions/Manifest/ClusterManifest.cs Adds AllGrainManifests ctor and implements manifest/property deduplication.
src/api/Orleans.Core/Orleans.Core.cs Public API update for GetCompatibleSilos and GetPlacementHint signatures.
src/api/Orleans.Core.Abstractions/Orleans.Core.Abstractions.cs Public API update for new ClusterManifest ctor and new equality members.

Copilot's findings

  • Files reviewed: 21/21 changed files
  • Comments generated: 6

Comment thread src/Orleans.Runtime/Manifest/ClusterManifestProvider.cs Outdated
Comment thread src/Orleans.Runtime/Placement/PlacementService.cs Outdated
Comment thread src/Orleans.Runtime/Placement/PlacementService.cs Outdated
Comment thread test/Orleans.Core.Tests/Runtime/PlacementServiceTests.cs Outdated
Comment thread src/Orleans.Core/Placement/IPlacementDirector.cs Outdated
Comment thread src/Orleans.Core.Abstractions/Manifest/ClusterManifest.cs Outdated
ReubenBond and others added 11 commits June 13, 2026 21:03
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>
Prune cluster manifests when membership versions advance so GrainVersionManifest and version selector caches only expose active silos. Simplify placement compatibility to trust those active-only caches while retaining the active-silo guard after extensible filters.

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>
Prune cluster manifests when membership versions advance so GrainVersionManifest and version selector caches only expose active silos. Simplify placement compatibility to trust those active-only caches while retaining the active-silo guard after extensible filters.

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>
@ReubenBond
ReubenBond force-pushed the reubenbond/active-silo-placement branch from 9bb75b5 to a61b8e7 Compare June 14, 2026 04:05
ReubenBond and others added 8 commits June 14, 2026 08:02
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>
Remove synchronous local silo insertion from the cluster manifest provider and let the standard manifest fetch path populate all active silos.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return immediately for same-version cluster manifests and only prune non-active silos when advancing to a newer membership version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rely on fetch success to indicate that all missing active silo manifests were retrieved, and treat null results as unsuccessful fetches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Copilot's findings

Comments suppressed due to low confidence (1)

src/Orleans.Runtime/MembershipService/SiloStatusOracle.cs:59

  • GetActiveSilos returns the internal cached array instance. Since arrays are mutable, a caller can inadvertently (or intentionally) modify the returned array and corrupt the oracle’s cache, affecting placement/liveness decisions.
        public SiloAddress[] GetActiveSilos()
        {
            EnsureFreshCache();
            return _activeSilos;
        }
  • Files reviewed: 14/14 changed files
  • Comments generated: 6

Comment thread src/Orleans.Runtime/Placement/PlacementService.cs
Comment thread src/Orleans.Runtime/Placement/PlacementService.cs Outdated
Comment thread src/Orleans.Runtime/Manifest/ClusterManifestProvider.cs
Comment thread src/Orleans.Runtime/Placement/PlacementService.cs
Comment thread test/Orleans.Core.Tests/General/RingTests_Standalone.cs
Synchronously add the local silo manifest when advancing to a membership version where the local silo is active.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ReubenBond and others added 4 commits June 14, 2026 14:56
Avoid re-deduplicating grain manifests which are already known canonical while preserving the fallback for equivalent unseen manifests.

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>
@ReubenBond ReubenBond changed the title fix: exclude shutting down silos from placement fix: exclude non-Active silos from placement Jun 15, 2026
@ReubenBond
ReubenBond merged commit ef8cb64 into dotnet:main Jun 15, 2026
62 checks passed
@ReubenBond
ReubenBond deleted the reubenbond/active-silo-placement branch June 15, 2026 03:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 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.

2 participants