mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Refactor is_failover_possible() (#2804)
* Refactor is_failover_possible() Move all the members filtering inside the function. * Remove check_synchronous parameter * Add sync_mode_is_active() method and user it everywhere where it is appropriate * Reduce nesting --------- Co-authored-by: Alexander Kukushkin <[email protected]>
This commit is contained in:
co-authored by
Alexander Kukushkin
parent
9dd177e5c9
commit
f24db395c6
@@ -748,7 +748,6 @@ class TestHa(PostgresInit):
|
||||
self.p.is_leader = true
|
||||
self.ha.has_lock = true
|
||||
self.ha.is_synchronous_mode = true
|
||||
self.ha.is_failover_possible = false
|
||||
self.ha.process_sync_replication = Mock()
|
||||
self.ha.cluster = get_cluster_initialized_with_leader(Failover(0, self.p.name, 'a', None), (self.p.name, None))
|
||||
self.assertEqual('no action. I am (postgresql0), the leader with the lock', self.ha.run_cycle())
|
||||
|
||||
Reference in New Issue
Block a user