Repository navigation
fix(directory): stabilize rolling upgrade handoff test - #10341
ReubenBond merged 2 commits into
Conversation
Move mandatory non-empty handoff coverage to the higher-load rolling upgrade scenario while preserving ordering checks in the restart-in-place scenario. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f6f95cf2-6bf9-4ee4-9a93-a9e9c1acebb9
There was a problem hiding this comment.
Pull request overview
Stabilizes Grain Directory rolling-upgrade tests by making the “non-empty split-partition handoff occurred” expectation conditional, so scenarios which can legitimately produce empty handoffs are no longer forced to fail. This keeps the durability/ordering validation while relocating the strict “must have exercised a handoff” requirement to the higher-load local-to-distributed upgrade test.
Changes:
- Added phase-aware log capture to the local-to-distributed rolling upgrade test and asserted that it exercises a non-empty split-partition handoff.
- Updated the restart-in-place rolling upgrade scenario to allow empty handoffs while still validating correct completion-before-removal ordering when handoffs occur.
- Extended
AssertSplitPartitionHandoffsAreDurablewith arequireNonEmptyHandoffswitch to support both behaviors.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryRollingUpgradeTests.cs | Makes split-partition handoff assertions conditional and relocates the “must be non-empty” requirement to the local-to-distributed scenario using phase-aware log capture. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Validate final directory ownership and registration state without recovery, fail release tests on integrity violations, and reject duplicate live activations. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f6f95cf2-6bf9-4ee4-9a93-a9e9c1acebb9
There was a problem hiding this comment.
Copilot's findings
Suppressed comments (3)
src/Orleans.Runtime/GrainDirectory/GrainDirectoryPartition.cs:873
- Similar to the other invariant exception, this message would be more actionable if it identified the partition/view/range which received an out-of-range registration (especially since this is thrown from a system target and may be surfaced remotely).
if (!IsOwner(current, entry.GrainId))
{
throw new InvalidOperationException(
$"Invariant violated. This host was sent a registration for grain '{entry.GrainId}' which it should not own.");
}
test/Orleans.GrainDirectory.Tests/GrainDirectory/GrainDirectoryRollingUpgradeTests.cs:1087
- The comment above this integrity check still refers to invoking recovery, but the code now only performs non-mutating validation (ValidateObservedAddressesAsync + CheckIntegrityAsync). Updating the comment will prevent confusion about whether recovery is still happening here.
var integrityChecks = distributedPartitions
.Select(static partition => partition.CheckIntegrityAsync().AsTask())
.ToArray();
src/Orleans.Runtime/GrainDirectory/GrainDirectoryPartition.cs:859
- This exception is now thrown in release builds, but the message does not include which partition/range/view detected the problem. Including the partition identity and membership version will make failures much easier to diagnose from test logs.
This issue also appears on line 869 of the same file.
{
if (!range.Contains(entry.Key))
{
throw new InvalidOperationException($"Invariant violated. This host is not the owner of grain '{entry.Key}'.");
}
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
The restart-in-place rolling upgrade test required a non-empty split-partition handoff even though its small grain set and randomized ring topology can legitimately produce only empty handoffs.
Move the mandatory non-empty durability assertion to the higher-load local-to-distributed upgrade scenario, where split handoffs are intentionally exercised. The restart-in-place scenario continues to verify that recipient completion precedes sender removal whenever a non-empty handoff occurs.
After final convergence, validate the complete live activation set: reject duplicate activations for a grain, require every activation to exactly match its directory registration, verify every directory entry belongs to the correct partition, and surface integrity violations in release builds. These checks are non-mutating so recovery cannot hide missing registrations.