Add membership table metadata#10174
Draft
ReubenBond wants to merge 1 commit into
Draft
Conversation
Add optional per-member membership metadata and surface availability through cluster membership snapshots. Store metadata across clustering providers, preserve unavailable metadata semantics for old schemas, and add ADO.NET migration scripts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Orleans cluster membership to support optional per-silo metadata, flowing it from membership table entries into runtime membership snapshots while preserving the semantic distinction between “metadata unavailable” (null) vs “metadata available but empty” (empty dictionary/object). It also updates several clustering providers and ADO.NET/Cassandra storage layers to round-trip that metadata when their underlying schemas support it (including forward-compatible schema evolution paths).
Changes:
- Add metadata support to
MembershipEntryand propagate it intoClusterMemberandClusterMembershipSnapshotupdates (including “metadata-only” changes). - Seed and maintain the runtime silo metadata cache from membership-table metadata when present, falling back to existing fetch behavior when not.
- Update clustering providers (Cassandra, ADO.NET, Consul, Cosmos DB, Azure Table, DynamoDB) plus schema/scripts/migrations and API surface files to support metadata persistence/round-tripping.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Runtime.Internal.Tests/ClusterMembershipSnapshotTests.cs | Adds tests ensuring unavailable vs empty metadata are distinguished and metadata-only changes produce updates. |
| test/Orleans.Core.Tests/Membership/MembershipTableSnapshotTests.cs | Adds tests ensuring MembershipEntry copy/update paths preserve metadata and metadata changes are treated as successor snapshots. |
| src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadata.cs | Adds constructors to initialize SiloMetadata from key/value pairs. |
| src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadaCache.cs | Seeds the silo metadata cache from membership-entry metadata when available. |
| src/Orleans.Runtime/MembershipService/MembershipTableSnapshotExtensions.cs | Projects membership table Metadata into ClusterMember metadata in cluster snapshots. |
| src/Orleans.Runtime/MembershipService/MembershipTableManager.cs | Captures configured local silo metadata and writes it into the local membership entry. |
| src/Orleans.Runtime/MembershipService/ClusterMembershipSnapshot.cs | Treats full ClusterMember equality (including metadata) as the change detector and preserves metadata on “dead” removals when available. |
| src/Orleans.Runtime/MembershipService/ClusterMember.cs | Extends public ClusterMember with optional metadata + availability semantics and metadata-aware equality. |
| src/Orleans.Core/SystemTargetInterfaces/IMembershipTable.cs | Adds MembershipEntry.Metadata plus copy/to-string propagation. |
| src/Orleans.Core/Runtime/MembershipTableSnapshot.cs | Treats metadata changes as successor changes for snapshot comparisons. |
| src/Orleans.Clustering.Consul/SerializableMembershipTypes.cs | Adds membership metadata to Consul serialized registration types and conversions. |
| src/Cassandra/Orleans.Clustering.Cassandra/OrleansQueries.cs | Adds Cassandra schema detection/evolution for metadata column and read/write support (JSON in metadata_json). |
| src/Cassandra/Orleans.Clustering.Cassandra/CassandraClusteringTable.cs | Reads/writes membership metadata when Cassandra schema supports it; clears metadata when unavailable. |
| src/Azure/Orleans.Clustering.Cosmos/Models/SiloEntity.cs | Adds metadata field to Cosmos membership entity model. |
| src/Azure/Orleans.Clustering.Cosmos/Membership/CosmosMembershipTable.cs | Round-trips metadata between MembershipEntry and Cosmos DB entity. |
| src/Azure/Orleans.Clustering.AzureStorage/SiloInstanceTableEntry.cs | Adds JSON metadata column on Azure Table entity and includes it in diagnostics output. |
| src/Azure/Orleans.Clustering.AzureStorage/AzureBasedMembershipTable.cs | Serializes/deserializes membership metadata to/from JSON for Azure Table storage. |
| src/AWS/Orleans.Clustering.DynamoDB/Membership/SiloInstanceRecord.cs | Adds DynamoDB attribute for metadata JSON and round-trip plumbing. |
| src/AWS/Orleans.Clustering.DynamoDB/Membership/DynamoDBMembershipTable.cs | Serializes/deserializes membership metadata JSON for DynamoDB membership table. |
| src/api/Orleans.Runtime/Orleans.Runtime.cs | Updates generated public API surface for ClusterMember and SiloMetadata. |
| src/api/Orleans.Core/Orleans.Core.cs | Updates generated public API surface for MembershipEntry.Metadata. |
| src/AdoNet/Shared/Storage/RelationalOrleansQueries.cs | Adds detection + parameter wiring for metadata JSON in ADO.NET membership inserts/updates. |
| src/AdoNet/Shared/Storage/DbStoredQueries.cs | Adds metadata support detection and deserialization from resultsets when present. |
| src/AdoNet/Orleans.Clustering.AdoNet/SQLServer-Clustering.sql | Adds MetadataJson column + query updates in SQL Server baseline script. |
| src/AdoNet/Orleans.Clustering.AdoNet/PostgreSQL-Clustering.sql | Adds MetadataJson column + function/query updates in PostgreSQL baseline script. |
| src/AdoNet/Orleans.Clustering.AdoNet/Oracle-Clustering.sql | Adds MetadataJson column + function/query updates in Oracle baseline script. |
| src/AdoNet/Orleans.Clustering.AdoNet/MySQL-Clustering.sql | Adds MetadataJson column + procedure/query updates in MySQL baseline script. |
| src/AdoNet/Orleans.Clustering.AdoNet/Migrations/SQLServer-Clustering-Metadata.sql | Adds SQL Server migration to add column and update stored queries. |
| src/AdoNet/Orleans.Clustering.AdoNet/Migrations/PostgreSQL-Clustering-Metadata.sql | Adds PostgreSQL migration to add column, update functions, and update stored queries. |
| src/AdoNet/Orleans.Clustering.AdoNet/Migrations/Oracle-Clustering-Metadata.sql | Adds Oracle migration to add column, update functions, and update stored queries. |
| src/AdoNet/Orleans.Clustering.AdoNet/Migrations/MySQL-Clustering-Metadata.sql | Adds MySQL migration to add column, recreate procedure, and update stored queries. |
| src/AdoNet/Orleans.Clustering.AdoNet/Messaging/AdoNetClusteringTable.cs | Clears metadata when ADO.NET schema/queries do not support metadata. |
Copilot's findings
- Files reviewed: 32/32 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional per-member metadata to membership entries and public cluster membership snapshots while preserving the distinction between unavailable metadata and available empty metadata.
The runtime now propagates configured silo metadata through membership snapshots and seeds the silo metadata cache from table metadata when available. Clustering providers round-trip metadata where supported, with ADO.NET migrations and Cassandra schema detection/evolution so old schemas continue to work with metadata marked unavailable.
Microsoft Reviewers: Open in CodeFlow