]> git.saurik.com Git - redis.git/commitdiff
Sentinel: reply -IDONTKNOW to get-master-addr-by-name on lack of info.
authorantirez <antirez@gmail.com>
Tue, 4 Sep 2012 14:06:53 +0000 (16:06 +0200)
committerantirez <antirez@gmail.com>
Thu, 27 Sep 2012 11:06:12 +0000 (13:06 +0200)
If we don't have any clue about a master since it never replied to INFO
so far, reply with an -IDONTKNOW error to SENTINEL
get-master-addr-by-name requests.

src/sentinel.c

index 7fdc45e36bed6cd271913f4fa157307fdf354060..70b6aa27c8bf83f7679d49b4bd81e01cceddee17 100644 (file)
@@ -2005,6 +2005,8 @@ void sentinelCommand(redisClient *c) {
         ri = sentinelGetMasterByName(c->argv[2]->ptr);
         if (ri == NULL) {
             addReply(c,shared.nullmultibulk);
+        } else if (ri->info_refresh == 0) {
+            addReplySds(c,sdsnew("-IDONTKNOW I have not enough information to reply. Please ask another Sentinel.\r\n"));
         } else {
             sentinelAddr *addr = ri->addr;