From 7d7e3f00e02f1a86e11a412a4db99ee25e0c5c66 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 10 Jan 2014 14:41:44 +0100 Subject: [PATCH] Sentinel: added SENTINEL MASTER command. With SENTINEL MASTERS it was already possible to list all the configured masters, but not a specific one. --- src/sentinel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sentinel.c b/src/sentinel.c index 8bc262ce4..4966a1dbd 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2378,8 +2378,14 @@ void sentinelCommand(redisClient *c) { if (!strcasecmp(c->argv[1]->ptr,"masters")) { /* SENTINEL MASTERS */ if (c->argc != 2) goto numargserr; - addReplyDictOfRedisInstances(c,sentinel.masters); + } else if (!strcasecmp(c->argv[1]->ptr,"master")) { + /* SENTINEL MASTER */ + sentinelRedisInstance *ri; + + if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) + == NULL) return; + addReplySentinelRedisInstance(c,ri); } else if (!strcasecmp(c->argv[1]->ptr,"slaves")) { /* SENTINEL SLAVES */ sentinelRedisInstance *ri;