Skip to content

Use JedisCluster.psetex() in JedisClusterStringCommands.pSetEx() instead own dispatch via Jedis [DATAREDIS-588] #1163

@spring-projects-issues

Description

@spring-projects-issues

Amarjit Thiyam opened DATAREDIS-588 and commented

This is as per the discussion we had in jedis & then turns out to be spring-data-redis issue.
Please refer: redis/jedis#1456

We have 3 masters with 1 slave per master in a redis cluster where we use single key SET & GET operations only on our cluster.

The code - https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/core/DefaultValueOperations.java#L192 looks for TimeUnit to be non MILLISECONDS & invokes a PsetX as we use MILLISECONDS as time unit with a cache ttl while set operation.

if (!TimeUnit.MILLISECONDS.equals(unit) || !failsafeInvokePsetEx(connection))

The JedisClusterConnection does getTopology()

topologyProvider.getTopology().getKeyServingMasterNode(key))

And I believe due to above, with 12+ clients (app servers) connected, we see 90+ connected clients for cluster/ping opertions. And in high load scenarios, we see issues and also cache SET is delayed due to a hop to refresh topology before actual SET operation.

Improvements/Issues:


Issue Links:

Referenced from: pull request #463

2 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions