Closed quantranhong1999 closed 2 months ago
That helps our Redis URIs setup be simpler: 1 URI (e.g. 1 K8s service endpoint) should be good enough. No need to manually configure writeServers and readServers for example.
:-1:
If you configure the IP of a signle node:
But if upon starting that one node is either down or unresponsive, then you are unable to discover the cluster and start.
THe best practice in other distibuted technologies is to keep a few seeds for topology discovery, in order to have resiliency on that discovery step.
EG for Cassandra 3 seeds for a 9 node cluster.
In practice for our setup we could pass the IPS of the 3 redis master nodes...
THe best practice in other distibuted technologies is to keep a few seeds for topology discovery, in order to have resiliency on that discovery step.
Sure. We still can declare multiple URIs: https://lettuce.io/core/release/api/io/lettuce/core/masterreplica/MasterReplica.html#connect-io.lettuce.core.RedisClient-io.lettuce.core.codec.RedisCodec-java.lang.Iterable-
Curently when redis.topology=cluster, RedisClusterClient would be used. I have tested RedisClusterClient against master/slave topology and it is still able to detect topology change. I have updated the setting for RedisClusterClient to enable automatic update of topology:
Previously I was confused between cluster topology and master-replica topology. New PR: https://github.com/apache/james-project/pull/2238
Why
Lettuce claims to support Topology Discovery for Redis Cluster and Redis Master/Replica. cf https://lettuce.io/core/release/reference/#masterreplica.standalone-masterreplica
writeServers
andreadServers
for example.Connecting to Master/Replica bears the possibility that individual nodes are not reachable. MasterReplica can still connect to a partially-available set of nodes.
cf: https://lettuce.io/core/release/api/io/lettuce/core/masterreplica/MasterReplica.html#:~:text=Connecting%20to%20Master%2FReplica%20bears,available%20(master%20or%20replica).Today our Lettuce only knows either Cluster setup or Standalone setup.
Thus we can not leverage the Master/Replica topology discovery.
How
Suggestion: introduce in
redis.properties
DoD
Tested the master/replica topology discovery.
May try to set up a Redis Master/Slave extension if not too complicated. Or at least a manual test. Scenario: Configure the Redis URI to a Replica node. Make sure sending a write command would succeed.