Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CLIENT PAUSE

Syntax
CLIENT PAUSE timeout [WRITE | ALL]
Available since:
3.0.0
Time complexity:
O(1)
ACL categories:
@admin, @slow, @dangerous, @connection,

CLIENT PAUSE is a connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds).

The command performs the following actions:

Client pause currently supports two modes:

For the WRITE mode, some commands have special behavior:

This command is useful as it makes able to switch clients from a Redis instance to another one in a controlled way. For example during an instance upgrade the system administrator could do the following:

Since Redis 6.2, the 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 master without risking accepting writes after the failover. This is also the mode used during cluster failover.

For versions before 6.2, it is possible to send CLIENT PAUSE in a MULTI/EXEC block together with the INFO replication command in order to get the current master offset at the time the clients are blocked. This way it is possible to wait for a specific offset in the replica side in order to make sure all the replication stream was processed.

Since Redis 3.2.10 / 4.0.0, 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.

Behavior change history

RESP2/RESP3 Reply

Simple string reply: OK or an error if the timeout is invalid.

History

RATE THIS PAGE
Back to top ↑