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

Function disconnectMaster

src/replication.cpp:3906–3919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3904}
3905
3906void disconnectMaster(redisMaster *mi)
3907{
3908 if (mi->master) {
3909 if (FCorrectThread(mi->master)) {
3910 // This will cache the master and do all that fancy stuff
3911 if (!freeClient(mi->master) && mi->master)
3912 replicationCreateCachedMasterClone(mi);
3913 } else {
3914 // We're not on the same thread so we can't use the freeClient method, instead we have to clone the master
3915 // and cache that clone
3916 replicationCreateCachedMasterClone(mi);
3917 }
3918 }
3919}
3920
3921/* Set replication to the specified master address and port. */
3922struct redisMaster *replicationAddMaster(char *ip, int port) {

Callers 3

replicationAddMasterFunction · 0.85
replicationUnsetMasterFunction · 0.85
replicationCronFunction · 0.85

Calls 3

FCorrectThreadFunction · 0.85
freeClientFunction · 0.70

Tested by

no test coverage detected