When RedisCluster encountering Moved behavior #2120
Unanswered
yangbodong22011
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Moved redirections are followed transparently. However, without a topology refresh Lettuce would still send the command to the old master node to yield another redirect. In consequence, updating the topology would re-synchronize the cluster topology with the client and the client would send the next command directly to the current master to avoid redirects. Configuring topology refreshes makes a lot of sense to minimize the number of redirects. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that the cluster documentation mentions that handling
MOVED
andASK
is transparent, that is, without configuringtopologyRefreshOptions
, it should be able to handleMOVED
andASK
correctly, and refresh the topology.But in
io.lettuce.core.cluster.ClusterTopologyRefreshScheduler#onMovedRedirection
,Enable
is needed to refresh the topology:and I noticed
io.lettuce.core.cluster.ClusterTopologyRefreshOptions#DEFAULT_ADAPTIVE_REFRESH_TRIGGERS = Collections.emptySet()
, the default is the empty set, which does not containMOVED
, that means that the cluster receives moved, and the topology will not be refreshed if topologyRefreshOptions is not configured.my question is:
topologyRefreshOptions
must be configured, right? Otherwise, the topology cannot be updated after the cluster is scaled up or down.Beta Was this translation helpful? Give feedback.
All reactions