MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / replicationDiscardCachedMaster

Function replicationDiscardCachedMaster

src/replication.cpp:4435–4442  ·  view source on GitHub ↗

Free a cached master, called when there are no longer the conditions for * a partial resync on reconnection. */

Source from the content-addressed store, hash-verified

4433/* Free a cached master, called when there are no longer the conditions for
4434 * a partial resync on reconnection. */
4435void replicationDiscardCachedMaster(redisMaster *mi) {
4436 if (mi->cached_master == NULL) return;
4437
4438 serverLog(LL_NOTICE,"Discarding previously cached master state.");
4439 mi->cached_master->flags &= ~CLIENT_MASTER;
4440 freeClientAsync(mi->cached_master);
4441 mi->cached_master = NULL;
4442}
4443
4444/* Turn the cached master into the current master, using the file descriptor
4445 * passed as argument as the socket for the new master.

Callers 3

replicationAddMasterFunction · 0.85
replicationUnsetMasterFunction · 0.85

Calls 2

serverLogFunction · 0.85
freeClientAsyncFunction · 0.85

Tested by

no test coverage detected