MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pauseClients

Function pauseClients

app/redis-6.2.6/src/networking.c:3342–3358  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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. */
3342void 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. */
3361void unpauseClients(void) {

Callers 3

failoverCommandFunction · 0.85
clientCommandFunction · 0.85
clusterProcessPacketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected