Is there a way to auto discover new cluster node IP in Redis Cluster with Lettuce Is there a way to auto discover new cluster node IP in Redis Cluster with Lettuce kubernetes kubernetes

Is there a way to auto discover new cluster node IP in Redis Cluster with Lettuce


Courtesy of the first comment on the question above.

So I was able to resolve this as follows.

  • The above setup for the client with the given options is good. However, I had to set the disconnectedBehavior to ACCEPT_COMMANDS. This ensured that the client continues to engage with Redis for operations during the fail-over.
  • As a result of this continuous accepting of operations, for the first READ or WRITE that arrives at the client after the failover had successfully elected a new master, the clister will correctly return the new IP address of the new node. From henceforth the client knows whats the new IP for the slots held by the failed node.

This is a lazy approach to reconcile on the next attempt to READ or WRITE. But it works and I believe it's good enough. I am not sure if there are better ways to handle this.