Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

CLIENT GETREDIR

Last updated
CLIENT GETREDIR
Group
Connection
Complexity
O(1)
Arity
2 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

CLIENT GETREDIR returns where the invalidations of this connection go, as set by the REDIRECT option of CLIENT TRACKING.

An integer, in RESP2 and RESP3:

Reply Meaning
-1 Tracking is off.
0 Tracking is on and the invalidations come to this connection.
Another number The id of the connection they are redirected to.

The number is the id the redirect was set to, also after that connection has closed. CLIENT TRACKINGINFO lists broken_redirect among the flags when it has.

127.0.0.1:6379> CLIENT GETREDIR
(integer) -1
127.0.0.1:6379> CLIENT TRACKING ON
OK
127.0.0.1:6379> CLIENT GETREDIR
(integer) 0

Same replies as Redis 8 and Valkey 9.

CLIENT TRACKING, CLIENT TRACKINGINFO, CLIENT ID