CLIENT PAUSE timeout
CLIENT PAUSE 是一条连接控制命令，它能够将所有 Redis 客户端挂起指定的一段时间（以毫秒为单位）。
CLIENT PAUSEis a connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds).
- 命令以最快的速度直接返回 OK，所以其不会被自身所停止。
- It stops processing all the pending commands from normal and pub/sub clients. However interactions with slaves will continue normally.
- However it returns OK to the caller ASAP, so the
CLIENT PAUSEcommand execution is not paused by itself.
- When the specified amount of time has elapsed, all the clients are unblocked: this will trigger the processing of all the commands accumulated in the query buffer of every client during the pause.
这条命令非常有用，因为它使得能够按一种可控的方式将客户端从一个 Redis 实例（Instance）切按到另一个实例。
This command is useful as it makes able to switch clients from a Redis instance to another one in a controlled way.
- Pause the clients using
- Wait a few seconds to make sure the slaves processed the latest replication stream from the master.
- Turn one of the slaves into a master.
- Reconfigure clients to connect with the new master.
It is possible to send
CLIENT PAUSEin a
EXECblock together with the
INFOreplication 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 slave side in order to make sure all the replication stream was processed.