Skip to content

test(membership): wire provider conformance suites - #11332

Merged
ReubenBond merged 19 commits into
dotnet:mainfrom
ReubenBond:rb-membership-provider-conformance-wiring
Sep 21, 2026
Merged

ReubenBond merged 19 commits into
dotnet:mainfrom
ReubenBond:rb-membership-provider-conformance-wiring

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Problem

The membership conformance kit and provider changes are on main. Their runtime-required guarantees need coverage across native providers and testing transports using independently constructed handles, isolated cluster scopes, and original-scope deletion evidence.

Changes

  • Wire shared guarantees and generated histories into Azure, Cosmos, DynamoDB, Firestore, Redis, Consul, ZooKeeper, Cassandra, and three ADO.NET dialects, plus in-process membership and the real routed development system target.
  • Verify terminal deletion through the original native scope, including version metadata, with bounded existence queries and visible infrastructure errors.
  • Initialize legacy membership/gateway resources lazily and retain actual owners. DynamoDB fixture adapters capture original SDK clients through validated read-only fields and dispose them after admitted work; ordinary provider implementation and general production lifetime behavior remain unchanged.
  • Use normal-registration inputs and runtime-varying updates, preserving activation metadata and canonical corruption checks. Cleanup setup publishes owner heartbeats while live and verifies eligibility, coherent observations and cross-handle idempotence.
  • Await generated fixture lifecycle hooks. Hosted execution distributes the same seed-17 manifest into240/240/240/239 histories across four xUnit cases, preserving all959 identities, all18 operation kinds/multiplicities, original case objects and fresh scopes. Public/native defaults retain the full suite.
  • Explicitly select current fresh ADO.NET clustering SQL; Cosmos probes inherit the landed client/account consistency configuration.

ZooKeeper provider fixes extracted to #11338

The focused ZooKeeper production changes, provider-specific unit regressions, repeated native snapshot driver and SDK/socket diagnostics now belong to #11338. That PR adds bounded Polly read retries and explicit single-attempt conditional-write ownership while preserving the pinned SDK and one operation-owned connection.

Cleanup commit f87a985928e722d0d11acfad56767f893f2dc949 removes the moved hunks from this PR. The ZooKeeper production implementation and provider-specific unit file now match this PR's main baseline; the remaining ZooKeeper diff is its shared conformance factory/overrides, original-scope deletion probe/watcher, legacy initialization and required TestKit reference. All28 shared ZooKeeper conformance cases remain discoverable on both frameworks. Non-ZooKeeper changes are unchanged.

Both PRs target main from fork branches. The focused implementation is not copied into this wiring branch; its validation and human landing remain a separate dependency. This PR's current fresh gate is not a claim that the unmerged ZooKeeper fix has passed combined conformance. Existing connection-loss evidence remains visible, and neither PR is merged or auto-merged.

Historical ZooKeeper comparisons before extraction

The last complete pre-extraction gate at d292db3be19f2bfb09828bb1cdf52c85e91099c8 had67 successful checks,4 failures and1 expected Pages skip. The failures were both ZooKeeper native jobs and the two CI/test-result aggregates. Complete exact-head outcomes and diagnostic limits.

That commit removed the experimental eight-row admission barrier and restored concurrent reads across the full table on one operation-owned connection. It retained landed per-row membership-then-heartbeat sequencing, Sync/version/child-version fences, whole-view retries, native error visibility and actual completion ownership. Main already has all-row fanout from #11316. This correction removed waiting introduced by the experiments; it did not establish an overall reliability or end-to-end latency win.

The following records retain their original tested heads, including failures and unstarted repetitions. The external rebase onto main 0bfd95e8561699b3bb7c619b0b0d2378d84395bc preserved all23 prior patches before the latency correction and extraction follow-up.

Shape Scheduling Result
A: 20d1a962 Unbounded rows; sequential member/heartbeat Native snapshot failures observed; not the fixed12 driver.
B: b32894b5 One row; sequential member/heartbeat Fixed12 completed, but latency cost was not accepted as the final approach. Residual SDK reports73/net8 and89/net10 remained.
C: 69880ac1 Unbounded rows; concurrent member/heartbeat pairs Seven fixed repetitions completed, two failed, three were not started. Complete failed comparison.
D: 1204d79e Batches8; original sequential member/heartbeat Both modules186/190; ordinary concurrent reads and both repetition theories failed. Fixed12 yielded zero completed, four failed first iterations, eight not started. Complete D record.
Latency restoration: d292db3 Unbounded rows; landed sequential member/heartbeat net8:190/192, net10:188/192. Fixed12 yielded five completed, three failed, four not started. Complete record.

B/C/D and the restoration used the same fixed12 fresh scenarios, each starting with128 rows. The final two cleanup rounds retired two targets, leaving126 for the extra post-scenario stable timing. D produced no such timing samples. Its SDK report counts were at least380/net8(one capped capture) and168/net10(no caps). A separate Windows net8 SlowBVT job in D's run lost its hosted runner and is recorded on existing #11331, without a recovered test assertion or root-cause attribution.

For the restoration, five completed net8 repetitions produced stable samples of25.023-28.410ms in four cases and3185.930ms in one case; completed whole scenarios took27.932-76.612s. The other repetitions produced no stable timing. Captured SDK reset entries were at least685/net8(one SDK capture capped) and185/net10(no SDK capture capped). Native-event capture caps were0/net8 and1/net10.

The historical evidence identifies changes in request sequencing, snapshot fences and workload visibility; it does not prove which change first made the longstanding SDK false-reset path frequent. An empty TCP receive buffer is distinct from an empty ZooKeeper result; no dummy query/data was introduced.

Contract and scope boundaries

Canonical state and table-version CAS are required; physical row metadata and raw heartbeat values can vary. Broader supplied-entry Insert/Update documentation and ADO's retained activation metadata/omitted insertion votes remain explicit API/runtime-coverage discrepancies. The accepted current-ADO missing-row Dead analysis is limited to pre-heartbeat startup/self-retirement paths and their native insertion/cleanup/death-classification outcomes; it does not generalize to arbitrary peer-vote histories or independently lagging insertion IAM.

Fixture-owned lifecycle callbacks retain actual admitted work under their None-token boundary; ordinary operations retain real scenario tokens and native cancellation/close behavior, without a blanket hidden-work quiescence guarantee. Sequential read-after-write requirements remain pending explicit contract clarification. Mutation receipts/ReadRow retirement and general production DynamoDB lifetime are separate follow-ups.

The human-merged #11334 fix remains included through main ancestry. SDK observations and preserved native/wire evidence remain on #10435. Temporary packet capture has been removed. No SDK change, workload reduction, merge or auto-merge is included.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings September 19, 2026 00:08

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.

Copilot review overview

🔵 Needs a closer look

Broad provider coverage remains coupled with an unresolved moderate DynamoDB client-disposal issue.

Review effort: Lite
Findings: None

What changed in this PR

Wires membership conformance suites across native providers and testing transports, with lifecycle, isolation, deletion, and ownership coverage.

Changes:

  • Adds shared conformance fixtures and provider-specific probes.
  • Adds lifecycle and resource-ownership coverage.
  • Adds in-process shared-table and routed system-target tests.
  • One moderate issue remains: DynamoDB conformance handles do not dispose their SDK clients (1 vote).
File Reviewed change
test/​TestInfrastructure/​Orleans.TestingHost.Tests/​Orleans.TestingHost.Tests.csproj Adds conformance dependencies.
test/​TestInfrastructure/​Orleans.TestingHost.Tests/​InProcessMembershipTableConformanceTests.cs Tests shared in-process membership state.
test/​Orleans.Runtime.Internal.Tests/​Orleans.Runtime.Internal.Tests.csproj References the conformance kit.
test/​Orleans.Runtime.Internal.Tests/​MembershipTests/​MembershipTableTestsBaseLifecycleTests.cs Covers legacy lifecycle behavior.
test/​Orleans.Runtime.Internal.Tests/​MembershipTests/​MembershipTableTestsBase.cs Adds lazy ownership and conformance plumbing.
test/​Orleans.Runtime.Internal.Tests/​MembershipTests/​MembershipTableConformanceTestsBase.cs Exposes shared conformance guarantees.
test/​Orleans.Core.Tests/​Orleans.Core.Tests.csproj Links shared conformance tests.
test/​Orleans.Core.Tests/​Membership/​SystemTargetMembershipTableConformanceTests.cs Tests routed system-target membership.
test/​Extensions/​Orleans.Redis.Tests/​Orleans.Redis.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Redis.Tests/​Clustering/​RedisMembershipTableTests.cs Adds Redis conformance wiring.
test/​Extensions/​Orleans.Cosmos.Tests/​Orleans.Cosmos.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Cosmos.Tests/​CosmosMembershipTableTests.cs Adds Cosmos fixtures and probes.
test/​Extensions/​Orleans.Clustering.ZooKeeper.Tests/​ZookeeperMembershipTableTests.cs Adds ZooKeeper conformance wiring.
test/​Extensions/​Orleans.Clustering.ZooKeeper.Tests/​Orleans.Clustering.ZooKeeper.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Clustering.Firestore.Tests/​Orleans.Clustering.Firestore.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Clustering.Firestore.Tests/​FirestoreMembershipTableTests.cs Adds Firestore conformance wiring.
test/​Extensions/​Orleans.Clustering.Consul.Tests/​Orleans.Clustering.Consul.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Clustering.Consul.Tests/​ConsulMembershipTableTest.cs Adds Consul conformance wiring.
test/​Extensions/​Orleans.Clustering.Cassandra.Tests/​Orleans.Clustering.Cassandra.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Clustering.Cassandra.Tests/​Clustering/​CassandraMembershipTableConformanceFixture.cs Adds Cassandra ownership and probes.
test/​Extensions/​Orleans.Clustering.Cassandra.Tests/​Clustering/​CassandraClusteringTableTests.cs Integrates Cassandra conformance tests.
test/​Extensions/​Orleans.Azure.Tests/​Orleans.Azure.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.Azure.Tests/​AzureMembershipTableTests.cs Adds Azure conformance wiring.
test/​Extensions/​Orleans.AWS.Tests/​Orleans.AWS.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.AWS.Tests/​MembershipTests/​DynamoDBMembershipTableTest.cs Adds DynamoDB conformance wiring; SDK client disposal remains unresolved.
test/​Extensions/​Orleans.AdoNet.Tests/​SqlServerMembershipTableTests.cs Adds SQL Server conformance probes.
test/​Extensions/​Orleans.AdoNet.Tests/​PostgreSqlMembershipTableTests.cs Adds PostgreSQL conformance probes.
test/​Extensions/​Orleans.AdoNet.Tests/​Orleans.AdoNet.Tests.csproj Adds the test-kit dependency.
test/​Extensions/​Orleans.AdoNet.Tests/​MySqlMembershipTableTests.cs Adds MySQL conformance probes.
test/​Extensions/​Orleans.AdoNet.Tests/​AdoNetMembershipTableConformanceProbe.cs Implements native ADO.NET deletion checks.
src/​Orleans.TestingHost/​InProcess/​InProcessMembershipTable.cs Enables shared in-process backing state.

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

Copilot AI review requested due to automatic review settings September 19, 2026 00:50

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.

Copilot review overview

🟡 Changes recommended

Resolve the Cassandra deletion/initialization issues, DynamoDB client ownership leak, Consul unbounded scans, and in-process version validation gap.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Dispose DynamoDB clients created by conformance handles

test/​Extensions/​Orleans.AWS.Tests/​MembershipTests/​DynamoDBMembershipTableTest.cs:81

Each conformance handle initializes a new DynamoDBMembershipTable, whose initialization constructs and retains an AmazonDynamoDBClient inside DynamoDBStorage, but these handles have no disposer. With three handles per guarantee, the suite leaks a client (and its HTTP resources) per handle; return a disposer which owns the provider's client, or add/consume an explicit provider disposal path.

@ReubenBond

Copy link
Copy Markdown
Member Author

Review-body disposition and scope update:

  • The Cassandra SERIAL-read inline comment has been answered with the exact driver/protocol distinction and executed deletion/generated-history results across Cassandra 4.0/4.1/5.0 on both frameworks. The existing serial-read guarantee is retained.
  • Cassandra fixture initialization reserves native ownership before asynchronous creation, shares one SDK cluster per fixture, and releases it through returned handle disposal. The kit's admitted-operation boundary governs factory/probe/cleanup work; ordinary SDK operations retain their native cancellation/disposal contract.
  • Consul's probe now requests keys rather than full values. Its consistent prefix query covers member, heartbeat, and version keys; that API is one unpaged request, so an empty result proves scope absence without a misleading version-key-only shortcut.
  • The in-process change shares its existing backing table. Runtime writers construct candidates through TableVersion.Next(). Broader invalid-input/overflow requirements are part of the explicit contract reassessment, not new provider validation added here.
  • I still own the DynamoDB client-lifetime concern in this wiring work. Its separate patch passes 215 focused cases per framework locally but is not published; this note does not claim that feedback resolved. It remains held for explicit scope disposition alongside the draft's outstanding native gate.

Following the user's contract clarification, the ADO insert-vote expansion and Azure cleanup-progress expansion were removed from the net diff. Required histories now insert empty suspicion lists, establish votes through canonical updates, and verify cleanup safety/coherent observations/idempotence with native errors visible to the caller. The public Insert wording versus broader nonempty-vote insertion behavior is recorded as a documentation/runtime-coverage discrepancy for a separate decision. Sequential freshness assumptions remain explicitly unsettled; existing fences/checks have been retained conservatively rather than weakened by inference.

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.

Copilot review overview

🔵 Needs a closer look

Five unresolved moderate findings affect resource cleanup and deletion verification.

Review effort: Lite
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 19, 2026 02:43

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.

Copilot review overview

🟡 Changes recommended

Two unresolved moderate findings remain in the membership model and Cassandra resource disposal.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

@ReubenBond

Copy link
Copy Markdown
Member Author

Exact-head gate update for a33caf7f48d0afb94b1231f2e41831cf7b4476b5, run 35416500475: 67 checks successful, four failed, one expected Pages deployment skip, zero pending. The two substantive failures are ZooKeeper ConcurrentReadAll_ReturnsOnlyAtomicCommittedViews on net8.0/net10.0; CI and .NET Test Results are aggregate failures. The PR remains draft.

Verified actual artifacts:

  • ADO: all three native dialects pass 38/38 membership cases on each framework, including the generated suite. No SQL expansion is in the net diff.
  • Real hosted system target: all 28 cases pass on Windows/Linux and both frameworks; generated runs execute 959 histories and all 18 operation kinds. Windows net8 took 9m25.949s. The earlier watchdog was not reproduced; these results do not establish its root cause.
  • Pure kit: 229/229 pass in each of the four BVT jobs, including all six generated storage variants. The separately tracked test(clustering): torn point-read conformance fault injection can time out in BVT #11333 barrier failure was not reproduced.
  • ZooKeeper: 36/37 membership cases pass on each framework, zero skipped. SDK diagnostics identify SocketException (104) at SocketContext.GetResult():84, matching the transport path in shayhatsor/zookeeper#45. The stack alone does not distinguish the SDK's synthetic reset check from a genuine network reset. Current evidence is attached to existing tracking #10435; fix(zookeeper): tolerate transient connection loss #10437 is already in this branch's ancestry. No added retry, timeout increase, reduced workload, skip, or replacement client has been applied.

Review disposition: the new model-input inline finding is answered and resolved with the actual input replacement and executed zero-populated-insert assertions. The overview additionally mentions Cassandra resource disposal without a location or failing scenario. The fixture reserves pending factories, owns its new SDK cluster, uses caller-owned provider sessions, and closes that cluster after the final returned/pending handle releases ownership. The independently borrowed container probe session remains owned by the unchanged shared test infrastructure. This ownership explanation remains applicable; any distinct scenario in that overview needs a concrete location/trace before a further change can be justified. The separate DynamoDB client-lifetime patch remains locally validated but unpublished and explicitly unresolved.

Copilot AI review requested due to automatic review settings September 19, 2026 03:23

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.

Copilot review overview

🟡 Changes recommended

Fix the critical ZooKeeper listener initialization defect before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 19, 2026 04:10
@ReubenBond

Copy link
Copy Markdown
Member Author

The 0ca4357c gate completed with all native-provider jobs green; ZooKeeper executed 177/177 cases on each framework, including the original native-error positive control. This is head-specific success, not a transport fix. Its successful modules did not retain stderr, so missing native messages cannot be interpreted; ac191278 now preserves capped native/SDK diagnostic artifacts under the existing always-upload rules.

The remaining failure on that head was the Windows net8 hosted generated test's ten-minute inactivity watchdog. Its last artifact shows case 885/959 in host deployment with a 225ms phase age: it was progressing at the cutoff, rather than stalled in that final phase. Earlier phase costs remain unknown.

The smaller lifecycle correction is published separately as b471d7fa: the exact installed Accordant 0.1.6 supports and awaits asynchronous fixture hooks, so the two synchronous bridges have been replaced with awaited hooks. A regression reproduced the old blocked invocation and passes after the correction; focused lifecycle/ownership checks pass on both frameworks, and runner checks pin all 959 fresh histories. Generation, seed, operations, replay, isolation, and public APIs are unchanged. No partitioning or watchdog increase has been introduced.

Current head is ac19127890c6e11965714fc7e30a7524ef1fd66d; exact-head CI 35420571779 is running. The draft gate remains open, including the held DynamoDB resource-lifetime disposition. The listener-construction inline finding was resolved using exact compiled constructor ordering and an existing-source control, rather than adding a null fallback.

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.

Copilot review overview

🟡 Changes recommended

A critical compilation issue and three moderate resource-lifecycle issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

@ReubenBond

Copy link
Copy Markdown
Member Author

Exact-head gate for ac19127890c6e11965714fc7e30a7524ef1fd66d, CI 35420571779: 68 successful checks, three failures, one expected Pages skip, zero pending. The substantive failing job is ZooKeeper net10; the other failures are aggregate checks. The PR remains draft.

All four hosted suites now pass the unchanged 959 generated histories and all 18 operation kinds. Generated durations: Windows net8 6m15.071s, Windows net10 8m27.175s, Ubuntu net8 4m59.115s, Ubuntu net10 5m22.576s. Pure-kit modules pass 230/230 in all four jobs. These are exact-head results after removing the synchronous lifecycle bridges; they do not establish a general throughput guarantee or fix #11333.

ZooKeeper net8 passes 177/177. net10 passes 175/177, with concurrent full-row and point-row reads failing. The retained artifacts and positive native-error control now show SDK-reported resets without original native ConnectionReset events in the two uncapped failing captures. Normal-close OperationAborted and a WouldBlock/EAGAIN are visible, and server Broken pipe follows the first SDK reset timestamps. This narrows the error translation boundary while leaving orderly FIN/local-close attribution open; no transport workaround or dependency change is included.

The latest missing-usings inline finding is resolved using the SDK-generated global imports, the explicit TestKit import, and the actual successful Cassandra builds. The overview's unspecified resource-lifecycle concerns remain distinguished from that disproved compilation claim; prior ownership explanations and the explicitly held DynamoDB correction remain recorded. No merge or auto-merge action was taken.

Copilot AI review requested due to automatic review settings September 19, 2026 04:57

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.

Copilot review overview

🔵 Needs a closer look

A critical Cassandra fixture ownership issue remains, and the broad provider changes require human review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 19, 2026 05:58

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.

Copilot review overview

🔵 Needs a closer look

The shared CAS retry path needs missing-row retry handling and bounded backoff before approval.

Review effort: Lite
Findings: None

Resolved since last review (1)

Move provider-specific changes and regression diagnostics to dotnet#11338 while retaining shared conformance wiring and the original-scope deletion probe.
Copilot AI review requested due to automatic review settings September 21, 2026 19:24
@ReubenBond
ReubenBond force-pushed the rb-membership-provider-conformance-wiring branch from 26adc93 to aa9c03f Compare September 21, 2026 19:24

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.

Copilot review overview

🟡 Changes recommended

Resolve the Cassandra compilation errors and add Firestore resource disposal before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)

[TestProvider("Cassandra")]
[TestArea("Membership")]
public sealed class CassandraClusteringTableTests : IClassFixture<CassandraContainer>
public sealed partial class CassandraClusteringTableTests : MembershipTableFullConformanceTestsBase, IClassFixture<CassandraContainer>, IAsyncDisposable
@ReubenBond
ReubenBond merged commit 81be59a into dotnet:main Sep 21, 2026
72 checks passed
@ReubenBond
ReubenBond deleted the rb-membership-provider-conformance-wiring branch September 21, 2026 20:14
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 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