Skip to content

fix(directory): make rolling upgrade handoffs durable - #10323

Merged
ReubenBond merged 1 commit into
mainfrom
reubenbond-fix-grain-directory-rolling-upgrade
Aug 2, 2026
Merged

ReubenBond merged 1 commit into
mainfrom
reubenbond-fix-grain-directory-rolling-upgrade

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 1, 2026

Copy link
Copy Markdown
Member

During LocalGrainDirectory to DistributedGrainDirectory rolling upgrades, split-partition handoffs acknowledged queued registration work before it completed. The legacy owner could remove its entries first, briefly leaving no authoritative registration and allowing a duplicate activation to be created.

This change makes the handoff acknowledgment complete only after the distributed directory has installed the registrations and cleaned up losing activations. Repeated sender retries coalesce onto the existing transfer, and the rolling-upgrade test now verifies from structured diagnostics that recipient completion precedes sender removal and that a non-empty handoff was exercised.

Microsoft Reviewers: Open in CodeFlow

Wait for distributed-directory registration and duplicate cleanup before allowing the legacy owner to remove transferred entries. Coalesce retried handoffs and verify recipient completion precedes sender removal.

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

Copilot-Session: 4485bcb4-85f7-4611-8db5-ec91b5380f0c
Copilot AI review requested due to automatic review settings August 1, 2026 21:54

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 hardens LocalGrainDirectory → DistributedGrainDirectory rolling-upgrade split-partition handoffs by ensuring the receiver only acknowledges the handoff after registrations are installed and duplicate activations are cleaned up, preventing brief “no authoritative owner” windows which can lead to duplicate activations.

Changes:

  • Make DistributedRemoteGrainDirectory.AcceptSplitPartition await durable completion of registration + duplicate-activation cleanup, and coalesce in-flight retries onto an existing batch.
  • Update the rolling-upgrade test to assert (from structured diagnostics) that receiver completion occurs before sender-side removal, and that a non-empty handoff occurred.
  • Extend the test log capture to extract Silo/AddedSilo and Count from structured log state for stronger assertions.
Show a summary per file
File Description
test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryRollingUpgradeTests.cs Adds structured-log-based assertions validating durable handoff ordering and exercises a non-empty handoff path.
src/Orleans.Runtime/GrainDirectory/DistributedRemoteGrainDirectory.cs Changes split-partition acceptance to complete only after registrations/cleanup finish and deduplicates concurrent retries via a shared completion signal.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Comment thread src/Orleans.Runtime/GrainDirectory/DistributedRemoteGrainDirectory.cs Dismissed
@ReubenBond
ReubenBond merged commit 655f526 into main Aug 2, 2026
69 of 70 checks passed
@ReubenBond
ReubenBond deleted the reubenbond-fix-grain-directory-rolling-upgrade branch August 2, 2026 21:03
This was referenced Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 2, 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