CLIENT GETREDIR
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.
Return value
Section titled “Return value”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.
Examples
Section titled “Examples”127.0.0.1:6379> CLIENT GETREDIR(integer) -1127.0.0.1:6379> CLIENT TRACKING ONOK127.0.0.1:6379> CLIENT GETREDIR(integer) 0Compatibility
Section titled “Compatibility”Same replies as Redis 8 and Valkey 9.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.