diff options
author | antirez <antirez@gmail.com> | 2013-11-25 10:57:20 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-11-25 10:57:20 +0100 |
commit | d13635b2a9a4b93fdd5606f7a2aac0956434c6f6 (patch) | |
tree | c2e12e911a48fb09be07d301fbbc7006267f8e31 | |
parent | d2402022610e25fd6c330e1d9ecb81c5667b4f76 (diff) | |
download | redis-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.c | 2 |
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; |