Skip to content

fix(membership): default legacy snapshots to empty death history - #11602

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-legacy-membership-wire-compatibility
Oct 27, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-legacy-membership-wire-compatibility

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Problem

Membership snapshots written by older silos contain the original version and membership rows, with no retained death-history field. After #11589, deserializing those payloads leaves RecentlyDeadSilos null because the serializer bypasses constructors. Status lookup and snapshot merging then fail during rolling upgrades. This also affects 11.0.0-preview.1.

Solution

Store serialized field 3 in nullable private backing storage while keeping its field ID and IReadOnlySet<SiloAddress> type. Both snapshot types expose an immutable empty death-history set when that field is absent, establishing the non-null contract at the snapshot boundary while preserving canonical rows and constructor-time freezing.

Add real-wire regression cases for both snapshot types in both compatibility directions: legacy payloads decode with their original version and rows plus empty death history, and legacy readers preserve the version and rows from current payloads while skipping added fields.

Applies the isolated compatibility correction from the 10.x backport in #11593 to main.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 27, 2026 20:49

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.

🟢 Approval recommended

No active review issues are reported for the membership snapshot compatibility change.

No open issues 🎉

What changed in this PR

Fixes rolling-upgrade compatibility for Orleans membership snapshots from older silos by exposing empty death history when the serialized field is absent.

Changes:

  • Uses nullable backing storage in both snapshot types while preserving field ID 3, its serialized type, and constructor-time freezing.
  • Adds wire-format regression tests for legacy-to-current decoding and current-to-legacy preservation of membership versions and rows.
File Description
test/​Orleans.Core.Tests/​Membership/​MembershipTableSnapshotTests.cs Adds compatibility tests in both directions for both snapshot types.
src/​Orleans.Runtime/​MembershipService/​ClusterMembershipSnapshot.cs Defaults missing cluster death history to an immutable empty set.
src/​Orleans.Core/​Runtime/​MembershipTableSnapshot.cs Defaults missing membership-table death history to an immutable empty set.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request
Lines 84.01% (120,602 / 143,556)
Branches 73.82% (36,127 / 48,938)

Report-only conclusion: current-main baseline stale.

Current main advanced from 1ea0875 to 240eee5 while coverage was aggregated.

Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities.

The comparison remains report-only while normal line and branch variance is calibrated.

Coverage details

@ReubenBond
ReubenBond merged commit 9b5356e into dotnet:main Oct 27, 2026
95 checks passed
@ReubenBond
ReubenBond deleted the rb-legacy-membership-wire-compatibility branch October 27, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants