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

Function freeReplicationBacklog

src/replication.cpp:340–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338
339
340void freeReplicationBacklog(void) {
341 serverAssert(GlobalLocksAcquired());
342 listIter li;
343 listNode *ln;
344 listRewind(g_pserver->slaves, &li);
345 while ((ln = listNext(&li))) {
346 // g_pserver->slaves should be empty, or filled with clients pending close
347 client *c = (client*)listNodeValue(ln);
348 serverAssert(c->flags & CLIENT_CLOSE_ASAP || FMasterHost(c));
349 }
350 if (g_pserver->repl_backlog != g_pserver->repl_backlog_disk)
351 zfree(g_pserver->repl_backlog);
352 g_pserver->repl_backlog = NULL;
353}
354
355/* Add data to the replication backlog.
356 * This function also increments the global replication offset stored at

Callers 2

syncWithMasterFunction · 0.85
replicationCronFunction · 0.85

Calls 5

GlobalLocksAcquiredFunction · 0.85
listRewindFunction · 0.85
listNextFunction · 0.85
FMasterHostFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected