Do not wait for leader key to change after failover.

Previously, the leader key was watched for changes after a failover. This resulted in a delay
of up to 10 seconds to report a healthy failover back to the client.

With this patch, we are not relying on the role of a member registered in the dcs anymore.
This commit is contained in:
Feike Steenbergen
2015-11-06 15:02:13 +01:00
parent 3938359828
commit da23dd12f3
2 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -27,10 +27,10 @@ def get_cluster_not_initialized_without_leader():
def get_cluster_initialized_without_leader(leader=False, failover=None):
m = Member(0, 'leader', 28, {'conn_url': 'postgres://replicator:[email protected]:5435/postgres',
'api_url': 'http://127.0.0.1:8008/patroni', 'role':'replica'})
'api_url': 'http://127.0.0.1:8008/patroni'})
l = Leader(0, 0, m) if leader else None
o = Member(0, 'other', 28, {'conn_url': 'postgres://replicator:[email protected]:5436/postgres',
'api_url': 'http://127.0.0.1:8011/patroni', 'role':'replica'})
'api_url': 'http://127.0.0.1:8011/patroni'})
return get_cluster(True, l, [m, o], failover)