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

Function replicaFromMaster

src/replication.cpp:143–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143client *replicaFromMaster(redisMaster *mi)
144{
145 if (mi->master == nullptr)
146 return nullptr;
147
148 listIter liReplica;
149 listNode *lnReplica;
150 listRewind(g_pserver->slaves, &liReplica);
151 while ((lnReplica = listNext(&liReplica)) != nullptr)
152 {
153 client *replica = (client*)listNodeValue(lnReplica);
154 if (FSameHost(mi->master, replica))
155 return replica;
156 }
157 return nullptr;
158}
159
160/* Plain unlink() can block for quite some time in order to actually apply
161 * the file deletion to the filesystem. This call removes the file in a

Callers 1

propagateMasterStaleKeysFunction · 0.85

Calls 3

listRewindFunction · 0.85
listNextFunction · 0.85
FSameHostFunction · 0.85

Tested by

no test coverage detected