-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silo Metadata and Placement Filtering #9271
Silo Metadata and Placement Filtering #9271
Conversation
Question: Why is metadata handled separate from the existing membership table as suggested in #8189? |
Question: Why is this implemented in core instead of as a separate package? |
@rkargMsft this is something I really need. When can we expect this PR to move from draft? Thanks so much. |
When I’m back next week I’ll be working on the documentation to get this out of draft. I expect that others will be more available for feedback on the PR in the new year, too. |
Ordering of filters (through a parameter on the attribute) came up as being necessary as the documentation was being written. The order the attributes are applied in source is not necessarily the same order that they show up when querying metadata so explicit ordering is necessary. Getting the ordering support implemented atm. |
@rkargMsft I would suggest moving the following into assembly Orleans.Core.Abstractions:
And eventually move specific implementations for PreferredMatchSiloMetadataPlacementFilter and RequiredMatchSiloMetadataPlacementFilter into a separate assembly (eg: Orleans.Placement.Filtering). |
I agree with this comment
We can consider this, but I'm not in favor of fine-grained assembly/package model since it tends to degrade the user experience |
e1ea897
to
4fae612
Compare
Documentation PR up. Ready for review. |
src/Orleans.Core.Abstractions/Placement/PlacementFilterStrategy.cs
Outdated
Show resolved
Hide resolved
src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadataHostingExtensions.cs
Outdated
Show resolved
Hide resolved
src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadaCache.cs
Outdated
Show resolved
Hide resolved
src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadaCache.cs
Outdated
Show resolved
Hide resolved
src/Orleans.Runtime/Placement/Filtering/PreferredMatchSiloMetadataPlacementFilterStrategy.cs
Outdated
Show resolved
Hide resolved
Looks like all the outstanding feedback has been addressed. Is there any further review on this before considering it for merging? |
Any chance we can get this reviewed and released soon? This is the last piece my project is waiting on to be able to start using Orleans 🥳 |
@rkargMsft I'm also waiting for this to be released in order to be able to propose Orleans adoption based on a PoC that requires silo metadata information. Is there an expected release date? |
Hello there, great work thank you for that. Once it gets merged, what is the approximate release date? Is it going to be part of .NET 8/9 as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 16 out of 31 changed files in this pull request and generated 2 comments.
Files not reviewed (15)
- src/Orleans.Runtime/MembershipService/SiloMetadata/ISiloMetadataGrainService.cs: Evaluated as low risk
- src/Orleans.Runtime/Placement/Filtering/PlacementFilterDirectorResolver.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadataHostingExtensions.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadataGrainService.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadataClient.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadata.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/SiloMetadaCache.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/ISiloMetadataClient.cs: Evaluated as low risk
- src/Orleans.Runtime/Hosting/DefaultSiloServices.cs: Evaluated as low risk
- src/Orleans.Core.Abstractions/Manifest/GrainProperties.cs: Evaluated as low risk
- src/Orleans.Runtime/MembershipService/SiloMetadata/ISiloMetadataCache.cs: Evaluated as low risk
- src/Orleans.Core/Placement/IPlacementFilterDirector.cs: Evaluated as low risk
- src/Orleans.Core.Abstractions/Placement/PlacementFilterStrategy.cs: Evaluated as low risk
- src/Orleans.Runtime/Placement/Filtering/RequiredMatchSiloMetadataPlacementFilterAttribute.cs: Evaluated as low risk
- src/Orleans.Runtime/Placement/Filtering/PreferredMatchSiloMetadataPlacementFilterAttribute.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/Orleans.Runtime/Placement/Filtering/PreferredMatchSiloMetadataPlacementFilterStrategy.cs:24
- The error message 'Invalid ordered-metadata-keys property value.' is unclear. It should be more descriptive, such as 'The ordered-metadata-keys property value is invalid. Ensure it is a comma-separated string of metadata keys.'
throw new ArgumentException("Invalid ordered-metadata-keys property value.");
src/Orleans.Runtime/Placement/Filtering/PreferredMatchSiloMetadataPlacementFilterDirector.cs
Show resolved
Hide resolved
src/Orleans.Runtime/Placement/Filtering/PreferredMatchSiloMetadataPlacementFilterStrategy.cs
Show resolved
Hide resolved
Orleans.Core.Abstractions: - PlacementFilterAttribute - PlacementFilterStrategy Orelans.Core: - IPlacementFilterDirector - PlacementFilterExtensions
Co-authored-by: dmorganMsft <[email protected]>
4c4bce1
to
005d8c6
Compare
@rkargMsft thank you for your patience. This looks good to me. At some point in the future, we should consider designs for caching the result of compatibility checks + user-defined filters so that we do not have to run this process every time a grain is placed. I rebased on main and pushed some suggestions in a commit. Please take a look and if they look good to you then I'll give it one final pass and merge. |
Tell me more about the per-placement work? I thought that the Resolver only ran once per grain type and should be relatively trivial cost if no filters are defined. |
@rkargMsft |
EDIT: so that we don't paint ourselves into a corner, I'll create a new type and update the interface to use it: public readonly record struct PlacementFilterContext(GrainType GrainType, GrainInterfaceType InterfaceType, ushort InterfaceVersion); |
Ok, added. I converted the tests to use class fixtures to make them run faster |
var tasks = new List<Task>(1); | ||
var cancellation = new CancellationTokenSource(); | ||
Task OnRuntimeInitializeStart(CancellationToken _) | ||
Task? task = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This previous code was copied from DistributedGrainDirectory. Should there be a follow up issue to update usages of the prior pattern with this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should clean up the other instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #9360
Added #9361 |
Thank you @ReubenBond and @rkargMsft 🥳 ! |
This PR has two main features:
Additionally, there are specific implementations of Placement Filtering using the Silo Metadata to specify either required keys that must match, or an ordered set of preferred keys to use for filtering down placement candidates.
Microsoft Reviewers: Open in CodeFlow