-
Hello there! We are using Lettuce 6.2.6 in our application, along with Redis 7.0.9, deployed via spotahome/redis-operator in sentinel mode (3 sentinels, 1 upstream, 2 replicas). Due to the nature of the redis-operator, we can currently only provide one Sentinel address (the address of the Sentinel Kubernetes service) when creating our RedisURI, which is used to initialize the StatefulRedisMasterReplicaConnection. This results in us only establishing a Pub/Sub connection to one of the sentinels. If the Sentinel pod providing the Pub/Sub connection fails, clients will not be able to receive a topology refresh until lettuce attempts to reconnect and eventually connects to the next Sentinel instance through the Kubernetes service (round robin). As long as there is no failover attempt during this period of time, this should have no impact on our application. The question is, do you think we should somehow discover the other Sentinels using the Sentinel API before creating the StatefulRedisMasterReplicaConnection to be more resilient to outages, or should one subscription be enough? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Fully dynamic environments require lookups prior to running your application. While there is certainly some dynamic possible, when a Sentinel setup gets updated (adding or removing sentinels), it is not possible to fully reconfigure your infrastructure while your application is running. If you do not require Master/Replica functionality (replica reads), then I suggest using a service name and hide additional sentinels behind that service (Load-balancer-like). Lettuce queries in Sentinel mode a sentinel to obtain the master IP address upon connect and reconnect. That seems the easiest approach for now. |
Beta Was this translation helpful? Give feedback.
Fully dynamic environments require lookups prior to running your application. While there is certainly some dynamic possible, when a Sentinel setup gets updated (adding or removing sentinels), it is not possible to fully reconfigure your infrastructure while your application is running.
If you do not require Master/Replica functionality (replica reads), then I suggest using a service name and hide additional sentinels behind that service (Load-balancer-like). Lettuce queries in Sentinel mode a sentinel to obtain the master IP address upon connect and reconnect.
That seems the easiest approach for now.