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

Function replicationDiscardCachedMaster

app/redis-6.2.6/src/replication.c:2976–2983  ·  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

2974/* Free a cached master, called when there are no longer the conditions for
2975 * a partial resync on reconnection. */
2976void replicationDiscardCachedMaster(void) {
2977 if (server.cached_master == NULL) return;
2978
2979 serverLog(LL_NOTICE,"Discarding previously cached master state.");
2980 server.cached_master->flags &= ~CLIENT_MASTER;
2981 freeClient(server.cached_master);
2982 server.cached_master = NULL;
2983}
2984
2985/* Turn the cached master into the current master, using the file descriptor
2986 * passed as argument as the socket for the new master.

Callers 3

replicationSetMasterFunction · 0.85
replicationUnsetMasterFunction · 0.85

Calls 1

freeClientFunction · 0.70

Tested by

no test coverage detected