ASKING
ASKING
- Group
- Cluster
- Complexity
- O(1)
- Arity
- 1 (exactly, counting the command name)
- Flags
- fast
- HotKV Cloud
- All plans
- On-Premise
- no license needed
While a slot moves from one node to another, the source node answers a
command on a key that has already moved with -ASK <slot> <ip>:<port>. The
client then sends ASKING to the node named in the redirect, followed by the
command. ASKING lets that one next command run even though the target only
imports the slot and does not own it yet. The flag is cleared after the next
command.
Unlike -MOVED, an -ASK redirect is temporary: the client keeps sending
other commands for the slot to the source node until the move is done.
Cluster-aware clients, including every HotKV SDK and redis-cli -c, handle
this for you.
Return value
Section titled “Return value”Simple string OK in RESP2 and RESP3. With cluster mode off:
ERR This instance has cluster support disabled.
Examples
Section titled “Examples”10.0.0.1:6379> GET user:1000(error) ASK 1649 10.0.0.2:637910.0.0.2:6379> ASKINGOK10.0.0.2:6379> GET user:1000"alice"Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”CLUSTER SETSLOT, MIGRATE, READONLY, Clustering: Slots and redirects
Was this page helpful?
Thanks for the feedback.