Closed
Description
I am using Redis driver 4.0.3
with a redis cluster (4.0.10 - 3 master/3 slaves) and have noticed that the driver caches cluster information early on a fails to update when a cluster master is killed and is failover by a slave. The driver still tries to connect to the older node indefinitely if the master never comes back up.
Scenario:
- Start a Redis cluster as described here https://redis.io/topics/cluster-tutorial#creating-and-using-a-redis-cluster
- Connect driver with all 1 to 6 nodes in the cluster
::Redis.new({replica: true, cluster: [{host: "localhost", port: 7000}]})
- Read/write some random keys in an infinite loop from the cluster with a
rescue
to make sure::Redis::CannotConnectError
is handled and the script does not crash. - Kill a master node
- Notice the client is stuck and cannot connect to the shard master.
- Notice the redis cluster has elected the slave as master.
- Notice the client is still trying to connect to the original master node and not to the slave.
I would assume that this would have worked with a CLUSTER FAILOVER
command was issued, but not for crashes as the cluster state is never refreshed in this scenario?
Metadata
Metadata
Assignees
Labels
No labels