diff --git a/patroni/dcs/consul.py b/patroni/dcs/consul.py index 499c8ae1..d20be351 100644 --- a/patroni/dcs/consul.py +++ b/patroni/dcs/consul.py @@ -101,7 +101,9 @@ class Consul(AbstractDCS): except Exception: logger.exception("Can not destroy session %s", self._session) self._session = None + # force `watch` method to call `AbstractDCS.watch` instead of watching for leader key self.reset_cluster() + # fire up an event to wake up from `watch` and immediately run HA loop (to create the new session) self.event.set() self._ttl = ttl diff --git a/patroni/dcs/etcd.py b/patroni/dcs/etcd.py index beb494b5..48afe914 100644 --- a/patroni/dcs/etcd.py +++ b/patroni/dcs/etcd.py @@ -218,7 +218,9 @@ class Etcd(AbstractDCS): def set_ttl(self, ttl): ttl = int(ttl) if self._ttl != ttl: + # force `watch` method to call `AbstractDCS.watch` instead of watching for leader key self.reset_cluster() + # fire up an event to wake up from `watch` and immediately run HA loop (to update TTL of leader and member) self.event.set() self._ttl = ttl