Skip to content

test(grain-directory): make shutdown migration deterministic - #10610

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-shutdown-migration-state-loss-f34
Aug 17, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-shutdown-migration-state-loss-f34

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Problem

The shutdown migration regression depended on random fallback placement after the local silo entered ShuttingDown. If stale compatibility data still included the source silo, PreferLocalPlacement only selected it probabilistically, so the test could pass despite the state-loss defect or fail intermittently with reactivated default state.

The production synchronization fix is now covered by #10596, #10597, and #10599, but the integration test did not deterministically prove that the shutting-down source is excluded from migration candidates.

Solution

Initiate shutdown migration with an explicit placement hint targeting the source silo. Correct placement rejects that hint because the source is no longer compatible and migrates to the surviving silo. A regression which re-admits the source honors the hint, skips migration, and deterministically reproduces the lost state (42 becoming

Microsoft Reviewers: Open in CodeFlow

Force the migration path to reject a placement hint targeting the shutting-down source silo, so stale placement candidates reproduce state loss deterministically instead of probabilistically.

Co-authored-by: Copilot App <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.

Pull request overview

This PR updates the grain directory shutdown migration integration test to deterministically validate that a shutting-down source silo is excluded from migration placement candidates, preventing intermittent passes/failures caused by probabilistic fallback placement.

Changes:

  • Replace MigrateOnIdle() during ShuttingDown deactivation with an explicit GrainContext.Migrate(...) call supplying a placement hint targeting the source silo.
  • Ensure the test deterministically fails if placement incorrectly re-admits the shutting-down source (by honoring the hint and skipping migration).
Show a summary per file
File Description
test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryShutdownMigrationTests.cs Makes shutdown migration test deterministic by initiating migration with an explicit placement hint targeting the shutting-down source silo.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@ReubenBond
ReubenBond merged commit 03b5d51 into dotnet:main Aug 17, 2026
135 of 137 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-shutdown-migration-state-loss-f34 branch August 17, 2026 21:48
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 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