Pause clients up to the specified unixtime (in ms) for a given type of * commands. * * A main use case of this function is to allow pausing replication traffic * so that a failover without data loss to occur. Replicas will continue to receive * traffic to faciliate this functionality. * * This function is also internally used by Redis Cluster for the manual * failover procedure implemente
| 3340 | * In such a case, the duration is set to the maximum and new end time and the |
| 3341 | * type is set to the more restrictive type of pause. */ |
| 3342 | void pauseClients(mstime_t end, pause_type type) { |
| 3343 | if (type > server.client_pause_type) { |
| 3344 | server.client_pause_type = type; |
| 3345 | } |
| 3346 | |
| 3347 | if (end > server.client_pause_end_time) { |
| 3348 | server.client_pause_end_time = end; |
| 3349 | } |
| 3350 | |
| 3351 | /* We allow write commands that were queued |
| 3352 | * up before and after to execute. We need |
| 3353 | * to track this state so that we don't assert |
| 3354 | * in propagate(). */ |
| 3355 | if (server.in_exec) { |
| 3356 | server.client_pause_in_transaction = 1; |
| 3357 | } |
| 3358 | } |
| 3359 | |
| 3360 | /* Unpause clients and queue them for reprocessing. */ |
| 3361 | void unpauseClients(void) { |
no outgoing calls
no test coverage detected