1

I have a question about redis sentinel when there is a network partition

I started a redis server on server01 as master and a server on server02 as slave, there was a redis sentinel on another server, I setup a script to make the client point to the new master when failover。

Then a partition occurred isolating the master on server01, so the sentinel start a failover on server02, and the slave of server02 become the new master. All the clients are using the new master now, which is okay.

When the partition recovered, however, sentinel will send slaveof to the old master. The old master will then remove all the data and sync with the new master, even there is little difference between new master and old master. When there is more than one master-slave group, the sync command will take up all my bandwidth in my production environment.

So how to disable the auto slaveof? Is there a better idea?

Papulatus
  • 677
  • 2
  • 8
  • 18

1 Answers1

0

Do you want to remove the old-master all together? If so then before it comes back up issue a sentinel reset <podname> and it (the old-master) will be removed from Sentinel. Of course, then you won't have a slave to the new-master.

The way Redis currently works, the old master will always have to do a full re-sync with the new master to become a slave to it. So until replication changes in Redis itself as long as you want replication you'll have to accept the sync aspect.

That said, I'm not sure what you mean by "When there is more than one master-slave group...". Could you elaborate?

The Real Bill
  • 14,884
  • 8
  • 37
  • 39