Skip to content
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

Support ServicePartitionResolver with cache #57

Open
youyuanwu opened this issue Aug 3, 2024 · 0 comments
Open

Support ServicePartitionResolver with cache #57

youyuanwu opened this issue Aug 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@youyuanwu
Copy link
Collaborator

We need to implement a resolver on top of the fabric client similarliy in csharp: ServicePartitionResolver Class (Microsoft.ServiceFabric.Services.Client) - Azure for .NET Developers | Microsoft Learn

Reference: service-fabric-services-and-actors-dotnet/src/Microsoft.ServiceFabric.Services/Client/ServicePartitionResolver.cs at 6f7dc80b1f8e498df3bf2e1b0c41e75bc9ee9862 · microsoft/service-fabric-services-and-actors-dotnet (github.com)

"
Service instances or replicas can move around from node to node at any time for multiple reasons. The service address resolved through ServicePartitionResolver may be stale by the time your client code attempts to connect. In that case again the client needs to re-resolve the address. Providing the previous
ResolvedServicePartition
indicates that the resolver needs to try again rather than simply retrieve a cached address."

The resolver needs to handle stale endpoint entry and register notification callbacks.

@youyuanwu youyuanwu added the enhancement New feature or request label Aug 3, 2024
youyuanwu added a commit that referenced this issue Aug 13, 2024
Partial impl for #57 
FabricClient can register the service notification filter and unregister
it.
See dotnet
[documentation](https://learn.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync?view=azure-dotnet)
The registration mechanism is used inside the dotnet implementation of
[servicepartitionresolver](https://learn.microsoft.com/en-us/dotnet/api/microsoft.servicefabric.services.client.servicepartitionresolver?view=azure-dotnet)

The registered service to get notification will no longer need to pass
the previous endpoint resolve result to force a refresh. This is tested
in the stateful example app. But the notification seems to be not very
fast (lag of a couple of seconds). But this notification utilizes
FabricClient cache, and reduces the cluster api load.
I will compare with direct resolution next.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant