Repository navigation
fix(aws): preserve DynamoDB membership consistency - #11310
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the identified cleanup concurrency, malformed-row validation, version validation, and logging findings.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (3)
What changed in this PR
Hardens DynamoDB membership consistency, heartbeat handling, coherent reads, and cleanup behavior.
Changes:
- Adds atomic membership updates with monotonic heartbeat preservation.
- Improves paginated reads, error propagation, and cancellation handling.
- Adds conditional cleanup operations and focused regression coverage.
| File | Summary |
|---|---|
test/Orleans.Runtime.Internal.Tests/MembershipTests/MembershipTableTestsBase.cs |
Updates cleanup expectations. |
test/Extensions/Orleans.AWS.Tests/MembershipTests/DynamoDBMembershipTableUnitTests.cs |
Adds DynamoDB consistency and cleanup regression tests. |
src/AWS/Shared/Storage/DynamoDBStorage.cs |
Adds cancellation-aware item deletion. |
src/AWS/Orleans.Clustering.DynamoDB/Membership/DynamoDBMembershipTable.cs |
Implements membership updates, reads, heartbeat handling, and conditional cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage
Report-only conclusion: improved. The current-main baseline is commit 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 |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved malformed DynamoDB attribute handling can cause infinite retries or unsafe cleanup deletion.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three unresolved DynamoDB membership and cleanup findings remain, including one critical issue.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (1)
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One critical and two moderate unresolved issues remain in DynamoDBMembershipTable.cs.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (1)
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A critical missing-version handling issue and a misleading propagated-error log message remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1


DynamoDB membership changes need atomic canonical row/table updates, complete row replacement, and coherent views across paginated reads. Cleanup needs to retain live members and respect recent starts, heartbeats, and suspicion votes when those values change concurrently.
This change uses a conditional full-row
Putalongside a table-version update in one transaction, clearing removed suspicion data and validating the canonical row/table etags. A full-row replacement proceeds with those original canonical tokens after an owner heartbeat. The owning live silo writesIAmAliveTimeusing one unconditional, timestamp-onlyUpdateItemrequest with native cancellation and error propagation.Full-table reads retain main's opening strongly consistent version read and paginated strongly consistent query. Canonical writes already stamp each member with the new table version atomically; reads reject queried versions or member stamps newer than the opening view. This yields a coherent canonical view using one point read per attempt. Record deserialization validates numeric membership tokens and recency attributes. Missing version history in either the point read or query surfaces immediately. Structured transaction cancellation reasons distinguish canonical contention from other failures.
Cleanup prunes only Dead member rows whose start time, heartbeat, and every suspicion vote precede the exact exclusive cutoff, preserving the table-version record by identity. Native per-row conditional deletes check Dead status, the canonical row etag, and the independently updated heartbeat. The row etag protects concurrent status/start/vote changes while cleanup retains the existing unversioned Dead-pruning behavior. Cleanup runs in groups of at most 25 in-flight deletes and owns every started request until completion. An internal shared-storage overload forwards cancellation to
DeleteItemAsync.Cluster-wide administrative deletion retains its separate scoped batch path. The shared batch-delete helper inspects
UnprocessedItemsand surfaces partial deletion as a contextual logged failure, preserving one native request per batch and existing cancellation behavior. This covers both the membership and reminder callers of that helper.The focused SDK-mocked regressions cover heartbeat request shape/counts, successful canonical-token reuse after a heartbeat, atomic missing/stale-row and stale-table conflicts, malformed records, cleanup concurrency and conditions, tick-precision cutoffs, changes on either side of the version row during pagination, partial batch responses, and cancellation/error propagation. The separate prerequisite commit cherry-picks only the legacy cleanup-test preparation from #11308 (
bede893d290a9035f196f4c3ed58213d102efc6c). Provider-wide conformance wiring remains a follow-up.Microsoft Reviewers: Open in CodeFlow