Command Restrictions

Some Redis commands are supported by cluster DCS instances for multi-key operations in the same slot. For details, see Table 1.

Table 2 and Table 3 list the restricted commands for Proxy Cluster and read/write splitting DCS Redis 4.0 instances.

Table 4 and Table 5 list the restricted commands for Proxy Cluster and read/write splitting DCS Redis 5.0 instances.

Table 1 Redis commands restricted in Redis Cluster DCS instances

Category

Description

Set

SINTER

Returns the members of the set resulting from the intersection of all the given sets.

SINTERSTORE

Equal to SINTER, but instead of returning the result set, it is stored in destination.

SUNION

Returns the members of the set resulting from the union of all the given sets.

SUNIONSTORE

Equal to SUNION, but instead of returning the result set, it is stored in destination.

SDIFF

Returns the members of the set resulting from the difference between the first set and all the successive sets.

SDIFFSTORE

Equal to SDIFF, but instead of returning the result set, it is stored in destination.

SMOVE

Moves member from the set at source to the set at destination.

Sorted Set

ZUNIONSTORE

Computes the union of numkeys sorted sets given by the specified keys.

ZINTERSTORE

Computes the intersection of numkeys sorted sets given by the specified keys.

HyperLogLog

PFCOUNT

Returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable.

PFMERGE

Merges multiple HyperLogLog values into a unique value.

Keys

RENAME

Renames key to newkey.

RENAMENX

Renames key to newkey if newkey does not yet exist.

BITOP

Performs a bitwise operation between multiple keys (containing string values) and stores the result in the destination key.

RPOPLPUSH

Returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

String

MSETNX

Sets the given keys to their respective values.

While running commands that take a long time to run, such as FLUSHALL, DCS instances may not respond to other commands and may change to the faulty state. After the command finishes executing, the instance will return to normal.

Table 2 Redis commands restricted for Proxy Cluster DCS Redis 4.0 instances

Category

Command

Restriction

Sets

SMOVE

For a Proxy Cluster instance, the source and destination keys must be in the same slot.

Geo

GEORADIUS

  • For a Proxy Cluster instance, all keys transferred must be in the same slot.
  • For a Proxy Cluster instance with multiple databases, the STORE option is not supported.

GEORADIUSBYMEMBER

GEOSEARCHSTORE

Connection

CLIENT KILL

  • Only the following two formats are supported:
    • CLIENT KILL ip:port
    • CLIENT KILL ADDR ip:port
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

CLIENT LIST

  • Only the following two formats are supported:
    • CLIENT LIST
    • CLIENT LIST [TYPE normal|master|replica|pubsub]
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

SELECT index

Multi-DB of Proxy Cluster instances can be implemented by changing the keys. This solution is not recommended.

Constraints on supporting multi-DB for a Proxy Cluster instance:

  1. The backend storage rewrites keys based on certain rules. Keys in the exported RDB file are not the original keys but can still be accessed through the Redis protocol.
  2. The FLUSHDB command deletes keys one by one, which takes a long time.
  3. SWAPDB is not supported.
  4. The INFO KEYSPACE command does not return data of multiple databases.
  5. The DBSIZE command is time-consuming. Do not use it in the code.
  6. If multiple databases are used, the performance of the KEYS and SCAN commands deteriorates by up to 50%.
  7. LUA scripts do not support the use of multiple databases.
  8. The RANDOMKEY command does not support the use of multiple databases.
  9. By default, multi-DB is disabled. Before enabling or disabling this option for an instance, clear the instance data.

HyperLogLog

PFCOUNT

For a Proxy Cluster instance, all keys transferred must be in the same slot.

PFMERGE

Keys

RENAME

For a Proxy Cluster instance, all keys transferred must be in the same slot.

RENAMENX

SCAN

Proxy Cluster instances do not support the SCAN command in pipelines.

Lists

BLPOP

For a Proxy Cluster instance, all keys transferred must be in the same slot.

BRPOP

BRPOPLPUSH

Pub/Sub

PSUBSCRIBE

Proxy Cluster instances do not support keyspace event subscription, so there would be no keyspace event subscription failure.

Scripting

EVAL

  • For a Proxy Cluster instance, all keys transferred must be in the same slot.
  • When the multi-DB function is enabled for a Proxy Cluster instance, the KEYS parameter is modified. Pay attention to the KEYS parameter used in the Lua script.

EVALSHA

Server

MEMORY DOCTOR

For a Proxy Cluster instance, add the ip:port of the node at the end of the command.

MEMORY HELP

MEMORY MALLOC-STATS

MEMORY PURGE

MEMORY STATS

MEMORY USAGE

MONITOR

Strings

BITOP

For a Proxy Cluster instance, all keys transferred must be in the same slot.

MSETNX

Transactions

WATCH

For a Proxy Cluster instance, all keys transferred must be in the same slot.

Table 3 Redis commands restricted for read/write splitting DCS Redis 4.0 instances

Category

Command

Restriction

Connection

CLIENT KILL

  • Only the following two formats are supported:
    • CLIENT KILL ip:port
    • CLIENT KILL ADDR ip:port
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

CLIENT LIST

  • Only the following two formats are supported:
    • CLIENT LIST
    • CLIENT LIST [TYPE normal|master|replica|pubsub]
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.
Table 4 Redis commands restricted for Proxy Cluster DCS Redis 5.0 instances

Category

Command

Restriction

Sets

SMOVE

For a Proxy Cluster instance, the source and destination keys must be in the same slot.

Sorted sets

BZPOPMAX

For a Proxy Cluster instance, all keys transferred must be in the same slot.

BZPOPMIN

Geo

GEORADIUS

  • For a Proxy Cluster instance, all keys transferred must be in the same slot.
  • For a Proxy Cluster instance in multi-DB mode, the STORE option is not supported.

GEORADIUSBYMEMBER

GEOSEARCHSTORE

Connection

CLIENT KILL

  • Only the following two formats are supported:
    • CLIENT KILL ip:port
    • CLIENT KILL ADDR ip:port
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

CLIENT LIST

  • Only the following two formats are supported:
    • CLIENT LIST
    • CLIENT LIST [TYPE normal|master|replica|pubsub]
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

SELECT index

Multi-DB of Proxy Cluster instances can be implemented by changing the keys. This solution is not recommended.

Constraints on supporting multi-DB for a Proxy Cluster instance:

  1. The backend storage rewrites keys based on certain rules. Keys in the exported RDB file are not the original keys but can still be accessed through the Redis protocol.
  2. The FLUSHDB command deletes keys one by one, which takes a long time.
  3. SWAPDB is not supported.
  4. The INFO KEYSPACE command does not return data of multiple databases.
  5. The DBSIZE command is time-consuming. Do not use it in the code.
  6. If multiple databases are used, the performance of the KEYS and SCAN commands deteriorates by up to 50%.
  7. LUA scripts do not support the use of multiple databases.
  8. The RANDOMKEY command does not support the use of multiple databases.
  9. By default, multi-DB is disabled. Before enabling or disabling this option for an instance, clear the instance data.

HyperLogLog

PFCOUNT

For a Proxy Cluster instance, all keys transferred must be in the same slot.

PFMERGE

Keys

RENAME

For a Proxy Cluster instance, all keys transferred must be in the same slot.

RENAMENX

SCAN

Proxy Cluster instances do not support the SCAN command in pipelines.

Lists

BLPOP

For a Proxy Cluster instance, all keys transferred must be in the same slot.

BRPOP

BRPOPLPUSH

Pub/Sub

PSUBSCRIBE

Proxy Cluster instances do not support keyspace event subscription, so there would be no keyspace event subscription failure.

Scripting

EVAL

  • For a Proxy Cluster instance, all keys transferred must be in the same slot.
  • When the multi-DB function is enabled for a Proxy Cluster instance, the KEYS parameter will be modified. Pay attention to the KEYS parameter used in the Lua script.

EVALSHA

Server

MEMORY DOCTOR

For a Proxy Cluster instance, add the ip:port of the node at the end of the command.

MEMORY HELP

MEMORY MALLOC-STATS

MEMORY PURGE

MEMORY STATS

MEMORY USAGE

MONITOR

Strings

BITOP

For a Proxy Cluster instance, all keys transferred must be in the same slot.

MSETNX

Transactions

WATCH

For a Proxy Cluster instance, all keys transferred must be in the same slot.

Streams

XACK

Not supported when multi-DB is enabled for a Proxy Cluster instance.

XADD

XCLAIM

XDEL

XGROUP

XINFO

XLEN

XPENDING

XRANGE

XTRIM

XREVRANGE

XREAD

  • Not supported when multi-DB is enabled for a Proxy Cluster instance.
  • For a Proxy Cluster instance, multiple keys transferred must be in the same slot.
  • The BLOCK option is not supported.

XREADGROUP GROUP

Table 5 Redis commands restricted for read/write splitting DCS Redis 5.0 instances

Category

Command

Restriction

Connection

CLIENT KILL

  • Only the following two formats are supported:
    • CLIENT KILL ip:port
    • CLIENT KILL ADDR ip:port
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

CLIENT LIST

  • Only the following two formats are supported:
    • CLIENT LIST
    • CLIENT LIST [TYPE normal|master|replica|pubsub]
  • The id field has a random value, and it does not meet the idc1<idc2→Tc1<Tc2 requirement.

Streams

XREAD

  • Not supported when multi-DB is enabled for a Proxy Cluster instance.
  • For a Proxy Cluster instance, multiple keys transferred must be in the same slot.
  • The BLOCK option is not supported.

XREADGROUP GROUP