Help Center/ Distributed Cache Service/ User Guide (Paris Region) / FAQs/ Redis Usage/ Why Is Redisson Distributed Lock Not Supported by DCS Proxy Cluster Redis 3.0 Instances?
Updated on 2022-02-21 GMT+08:00

Why Is Redisson Distributed Lock Not Supported by DCS Proxy Cluster Redis 3.0 Instances?

Redisson implements lock acquisition and unlocking in the following process:

  1. Redisson lock acquisition and unlocking are implemented by running Lua scripts.
  2. During lock acquisition, the EXISTS, HSET, PEXPIRE, HEXISTS, HINCRBY, PEXPIRE, and PTTL commands must be executed in the Lua script.
  3. During unlocking, the EXISTS, PUBLISH, HEXISTS, PEXIPRE, and DEL commands must be executed in the Lua script.

In a proxy-based cluster, the proxy processes PUBLISH and SUBSCRIBE commands and forwards requests to the Redis server. The PUBLISH command cannot be executed in the Lua script.

As a result, Proxy Cluster DCS Redis 3.0 instances do not support Redisson distributed locks. To use Redisson, resort to Redis 4.0 or 5.0 instead.