Skip to content

Using RedisTemplate executePipeline , ping to all nodes #3122

Closed as not planned
@gary258796

Description

@gary258796

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions