Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-588

Use JedisCluster.psetex() in JedisClusterStringCommands.pSetEx() instead own dispatch via Jedis

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.2 RC2 (Moore)
    • Component/s: None
    • Labels:
      None

      Description

      This is as per the discussion we had in jedis & then turns out to be spring-data-redis issue.
      Please refer: https://github.com/xetorthio/jedis/issues/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:

      • Can we make 100ms configurable? if (cached != null && time + 100 > System.currentTimeMillis())

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mp911de Mark Paluch
              Reporter:
              amarjit.thiyam Amarjit Thiyam
              Last updater:
              Mark Paluch
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: