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

Redis implementation for IKeysMap.GetKeysAsync returns keys from only the first server on the endpoint list #46

Open
andre-ss6 opened this issue Jul 12, 2021 · 0 comments

Comments

@andre-ss6
Copy link
Contributor

andre-ss6 commented Jul 12, 2021

The current implementation for IKeysMap.GetKeysAsync on Take.Elephant.Redis.MapBase on L63 does:

var endpoint = ConnectionMultiplexer.GetEndPoints(true).FirstOrDefault();

And on L66:

var server = ConnectionMultiplexer.GetServer(endpoint);

And then proceeds to issue a KEYS /SCAN command to only that server. That won't return all keys from all servers,, though as KEYS is not issued to the logical database (the entire cluster), but only to the single physical server to which the command is being sent to. More info here.

It seems that the correct implementation should call ClusterNodes().Nodes on the server and then loop over all available endpoints.

Also, this method using the non-async Keys method.

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

1 participant