Bugfix: GET /cluster was showing stale member info in zookeeper (#1573)

Zookpeeper implementation heavily relies on cached version of the cluster view in order to minimize the number of requests. Having stale members information is fine for Patroni workflow because it basically relies only on member names and tags.

The `GET /cluster` is a different case. Being exposed outside it might be used for monitoring purposes and therefore we should show the up-to-date members information.
This commit is contained in:
Alexander Kukushkin
2020-06-05 09:23:54 +02:00
committed by GitHub
parent 6406b39b77
commit c2a78ee652
5 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ class TestZooKeeper(unittest.TestCase):
def test_get_cluster(self):
self.assertRaises(ZooKeeperError, self.zk.get_cluster)
cluster = self.zk.get_cluster()
cluster = self.zk.get_cluster(True)
self.assertIsInstance(cluster.leader, Leader)
self.zk.touch_member({'foo': 'foo'})