Fix activation-count placement fallback for partial statistics#9914
Merged
ReubenBond merged 5 commits intoFeb 13, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the activation count-based placement strategy by optimizing performance and fixing edge cases in fallback logic when silo statistics are partially available.
Changes:
- Removed per-placement
HashSetallocation by eliminating theToSet()call on compatible silos - Implemented reservoir sampling for uniform random selection when silos lack statistics
- Changed empty-cache fallback from local silo to random compatible silo placement
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/Orleans.Runtime/Placement/ActivationCountPlacementDirector.cs:112
- The error message mentions "from {silos.Length} compatible silos" but then enumerates all silos from _localCache (which includes incompatible silos). This could be confusing when debugging. Consider either:
- Filtering the enumeration to only show compatible silos:
Utils.EnumerableToString(silos.Select(s => KeyValuePair.Create(s, _localCache.GetValueOrDefault(s))), ...) - Clarifying the message:
"Unable to select a candidate from {silos.Length} compatible silos (all are overloaded). All silo stats: {Utils.EnumerableToString(all, ...)}"
throw new SiloUnavailableException($"Unable to select a candidate from {silos.Length} compatible silos: {Utils.EnumerableToString(all, kvp => $"SiloAddress = {kvp.Key} -> {kvp.Value}")}");
rkargMsft
pushed a commit
to rkargMsft/orleans
that referenced
this pull request
Feb 27, 2026
…t#9914) * Fix activation-count placement fallback with partial stats * Restore local fallback when placement stats cache is empty * Simplify activation-count fallback control flow * Fix activation-count placement local compatibility * Address PR review feedback
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
HashSetallocation inActivationCountPlacementDirectorValidation
dotnet test .\\test\\TesterInternal\\TesterInternal.csproj --filter "FullyQualifiedName~UnitTests.General.ElasticPlacementTests.LoadAwareGrainShouldNotAttemptToCreateActivationsOnOverloadedSilo" --nologo --verbosity minimal--no-buildruns of the same testMicrosoft Reviewers: Open in CodeFlow