Suspends commands processing.
CLIENT
PAUSE timeout
[WRITE |
ALL]
CLIENT PAUSE is a connections control command able to
suspend all the Valkey clients for the specified amount of time (in
milliseconds).
The command performs the following actions:
CLIENT PAUSE command execution is not paused by
itself.Client pause currently supports two modes:
ALL: This is the default mode. All client commands are
blocked.WRITE: Clients are only blocked if they attempt to
execute a write command.For the WRITE mode, some commands have special
behavior:
EVAL/EVALSHA: Will block client for all
scripts.PUBLISH: Will block client.PFCOUNT: Will block client.WAIT/WAITAOF: Acknowledgments will be
delayed, so these commands will appear blocked.This command is useful as it makes able to switch clients from a Valkey instance to another one in a controlled way. For example during an instance upgrade the system administrator could do the following:
CLIENT PAUSEThe recommended mode for client pause is WRITE. This
mode will stop all replication traffic, can be aborted with the CLIENT UNPAUSE command, and
allows reconfiguring the old primary without risking accepting writes
after the failover. This is also the mode used during cluster
failover.
This command also prevents keys to be evicted or expired during the time clients are paused. This way the dataset is guaranteed to be static not just from the point of view of clients not being able to write, but also from the point of view of internal operations.
Simple string
reply: OK or an error if the timeout is invalid.
O(1)
@admin @connection @dangerous @slow
CLIENT PAUSE WRITE mode added along with the
mode option.AUTH, CLIENT, CLIENT CACHING, CLIENT CAPA, CLIENT GETNAME, CLIENT GETREDIR, CLIENT HELP, CLIENT ID, CLIENT IMPORT-SOURCE, CLIENT INFO, CLIENT KILL, CLIENT LIST, CLIENT NO-EVICT, CLIENT NO-TOUCH, CLIENT REPLY, CLIENT SETINFO, CLIENT SETNAME, CLIENT TRACKING, CLIENT TRACKINGINFO, CLIENT UNBLOCK, CLIENT UNPAUSE, ECHO, HELLO, PING, QUIT, RESET, SELECT.