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

Function disconnectSlavesExcept

src/networking.cpp:1475–1487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1473}
1474
1475void disconnectSlavesExcept(unsigned char *uuid)
1476{
1477 serverAssert(GlobalLocksAcquired());
1478 listIter li;
1479 listNode *ln;
1480
1481 listRewind(g_pserver->slaves, &li);
1482 while ((ln = listNext(&li))) {
1483 client *c = (client*)listNodeValue(ln);
1484 if (uuid == nullptr || !FUuidEqual(c->uuid, uuid))
1485 freeClientAsync(c);
1486 }
1487}
1488
1489/* Close all the slaves connections. This is useful in chained replication
1490 * when we resync with our own master and want to force all our slaves to

Callers 2

syncWithMasterFunction · 0.85
disconnectSlavesFunction · 0.85

Calls 5

GlobalLocksAcquiredFunction · 0.85
listRewindFunction · 0.85
listNextFunction · 0.85
FUuidEqualFunction · 0.85
freeClientAsyncFunction · 0.85

Tested by

no test coverage detected