Skip to content

Sentinel: close clients connections on old master demotion. #1083

@antirez

Description

@antirez

Currently a Sentinel-complaint client needs to check with a Sentinel what is the master address only on reconnection. This is usually enough as the client should be configured with a timeout that is smaller compared to the time needed for a master to be considered down.

However it is possible that a client will not notice that a master was down, for some reason, and after the failover, may continue to talk with the old master without noticing the switch.

In order to improve the reliability of HA using Sentinel probably different things should be done.

  • When the old master is already reachable, Sentinels should not just demote it, but also kill all the existing client connections, to force all the clients to reconfigure.

Also Sentinel complaint-clients:

  • Should force a reconnection when they get a -READONLY error from what's believed to be the master.
  • Should make sure to check with Sentinel that the master is still the same periodically.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions