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

Function sentinelGetMasterByNameOrReplyError

src/sentinel.cpp:3498–3509  ·  view source on GitHub ↗

Lookup the named master into sentinel.masters. * If the master is not found reply to the client with an error and returns * NULL. */

Source from the content-addressed store, hash-verified

3496 * If the master is not found reply to the client with an error and returns
3497 * NULL. */
3498sentinelRedisInstance *sentinelGetMasterByNameOrReplyError(client *c,
3499 robj *name)
3500{
3501 sentinelRedisInstance *ri;
3502
3503 ri = (sentinelRedisInstance*)dictFetchValue(sentinel.masters,ptrFromObj(name));
3504 if (!ri) {
3505 addReplyError(c,"No such master with that name");
3506 return NULL;
3507 }
3508 return ri;
3509}
3510
3511#define SENTINEL_ISQR_OK 0
3512#define SENTINEL_ISQR_NOQUORUM (1<<0)

Callers 2

sentinelCommandFunction · 0.85
sentinelSetCommandFunction · 0.85

Calls 3

dictFetchValueFunction · 0.85
ptrFromObjFunction · 0.85
addReplyErrorFunction · 0.85

Tested by

no test coverage detected