takenet/elephant

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

andre-ss6 opened this issue · 0 comments

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.