summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-11-25 10:57:20 +0100
committerantirez <antirez@gmail.com>2013-11-25 10:57:20 +0100
commitd13635b2a9a4b93fdd5606f7a2aac0956434c6f6 (patch)
treec2e12e911a48fb09be07d301fbbc7006267f8e31
parentd2402022610e25fd6c330e1d9ecb81c5667b4f76 (diff)
downloadredis-d13635b2a9a4b93fdd5606f7a2aac0956434c6f6.tar.gz
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.
-rw-r--r--src/sentinel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 9ae768597..7318832d0 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -2027,7 +2027,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;