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

Function FActiveMaster

src/replication.cpp:5266–5281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5264}
5265
5266int FActiveMaster(client *c)
5267{
5268 if (!(c->flags & CLIENT_MASTER))
5269 return false;
5270
5271 listIter li;
5272 listNode *ln;
5273 listRewind(g_pserver->masters, &li);
5274 while ((ln = listNext(&li)))
5275 {
5276 redisMaster *mi = (redisMaster*)listNodeValue(ln);
5277 if (mi->master == c)
5278 return true;
5279 }
5280 return false;
5281}
5282
5283redisMaster *MasterInfoFromClient(client *c)
5284{

Callers 2

lookupKeyReadWithFlagsFunction · 0.85
freeClientFunction · 0.85

Calls 2

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected