From 6f4fd5576242cc98829dbf0f4683adc703188a71 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 25 Nov 2013 10:57:20 +0100 Subject: [PATCH] Sentinel: fixes inverted strcmp() test preventing config updates. The result of this one-char bug was pretty serious, if the new master had the same port of the previous master, but just a different IP address, non-leader Sentinels would not be able to recognize the configuration change. This commit fixes issue #1394. Many thanks to @shanemadden that reported the bug and helped investigating it. --- src/sentinel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentinel.c b/src/sentinel.c index d6192005..ed2f56d9 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2025,7 +2025,7 @@ void sentinelReceiveHelloMessages(redisAsyncContext *c, void *reply, void *privd if (msgmaster->config_epoch < master_config_epoch) { msgmaster->config_epoch = master_config_epoch; if (master_port != msgmaster->addr->port || - !strcmp(msgmaster->addr->ip, token[5])) + strcmp(msgmaster->addr->ip, token[5])) { sentinelAddr *old_addr;