mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
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:
+2
-2
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user