-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using RedisTemplate executePipeline , ping to all nodes #3122
Comments
RESP2:
RESP3
I think what you're seeing is the difference between RESP2 and RESP3 handling. In RESP2, Ping before activate is issued as PING command while RESP3 uses on the Once a connection is established, you won't see the PING commands. That is Lettuce driver behavior.
Have you considered lowering the timeout? In any case, these are all Lettuce driver concerns, not related to Spring Data. |
I have deployed a Redis Cluster in my system with a configuration of 3 masters and 3 slaves, where all 6 nodes are on different machines.
And I have set up the following configuration, ensures that the system performs all read and write operations only through the master nodes, while the slave nodes are only used for data backup.
LettuceClientConfiguration.LettuceClientConfigurationBuilder lettuceClientConfigurationBuilder = LettuceClientConfiguration.builder(); lettuceClientConfigurationBuilder.readFrom(ReadFrom.MASTER);
And I have set up the following configuration of my RedisTemplate, which 'pingBeforeActivateConnection' is set to true.
ClusterClientOptions.Builder clusterClientOptionsBuilder = ClusterClientOptions.builder(); clusterClientOptionsBuilder.autoReconnect(true).pingBeforeActivateConnection(true);
I noticed that when using the redisTemplate.executePipelined command, it pings all Redis nodes. But why?
Other commands like opsForValue().get() and opsForList().rightPush() don’t ping all nodes.
This causes a problem when any machine is down because the ping is still executed, forcing my application to wait until the ping times out.
The text was updated successfully, but these errors were encountered: