Skip to content

Introducing periodic topology mechanism for JedisCluster #3595

@yangbodong22011

Description

@yangbodong22011

The current JedisCluster strategy for reacquiring routing tables (calling Cluster Slots) is:

  1. When the client encounters the server, it returns MOVED.
  2. When the client fails for maxAttempts times.

One of our customers, who was using JedisCluster but in a quiescent state (i.e. without any access), initially connected to cluster A, but then some of the nodes in cluster A were taken offline and the IPs were reused in cluster B. At this time JedisCluster is connected to cluster B.

How to Fix

We need to add a periodic topology refresh mechanism to JedisCluster. For example, Lettuce's enablePeriodicRefresh parameter.

ClusterTopologyRefreshOptions refreshOptions = ClusterTopologyRefreshOptions.builder()
    .enablePeriodicRefresh(Duration.ofSeconds(15)).build();

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions