Commit 6f4fd557 authored by antirez's avatar antirez
Browse files

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.
parent 8d547ebd
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment