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

The MembershipTable implementations of Microsoft.Orleans.Clustering.Redis and Microsoft.Orleans.Clustering.AdoNet are inconsistent #8961

Open
pb0501x opened this issue Apr 28, 2024 · 2 comments

Comments

@pb0501x
Copy link

pb0501x commented Apr 28, 2024

The MembershipTable implementations of Microsoft.Orleans.Clustering.Redis and Microsoft.Orleans.Clustering.AdoNet are inconsistent because the clusterKey of Microsoft.Orleans.Clustering.Redis contains serviceId, so two keys are stored in the Hash structure of redis. When my client connects to service1's IGrain. Then use service2's IGrain in service1. An exception will occur at this time. The reason for the exception is that the interface cannot be implemented. The solution is to put _clusterKey = Encoding.UTF8.GetBytes($"{_clusterOptions.ServiceId}/members/{_clusterOptions.ClusterId}");=> in the RedisMembershipTable constructor
_clusterKey = Encoding.UTF8.GetBytes($"members/{_clusterOptions.ClusterId}");
In this way, the expected cluster behavior of the two libraries is consistent.

@ReubenBond
Copy link
Member

@pb0501x can you confirm that this PR is about ADO.NET & Redis? Or is it about two different Redis providers?

@pb0501x
Copy link
Author

pb0501x commented Apr 30, 2024

What I want to express is that the essential principle of implementing IMembershipTable should be the same between Microsoft.Orleans.Clustering.Redis and Microsoft.Orleans.Clustering.AdoNet. When I tested using ADO.NET, they had the same clusterId, but different serviceId. When starting silo, service1 and service2 can be recognized normally, but when based on redis, they cannot recognize each other and exist independently of each other. I looked at the source code and found that the problem is that the implementation of RedisMembershipTable uses the "serviceId/members/clusterId" combination as the only key, so different serviceIds cannot be combined with the same clusterId to form a cluster.
@ReubenBond

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants