From 9bd0e097aa19b697757cdb73dd447e2c6f4960c6 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 4 Sep 2012 16:06:53 +0200 Subject: [PATCH] Sentinel: reply -IDONTKNOW to get-master-addr-by-name on lack of info. 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sentinel.c b/src/sentinel.c index 7fdc45e3..70b6aa27 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -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; -- 2.45.2