mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-26 23:50:23 +00:00
Do not drop active replication slots
This commit is contained in:
@@ -346,6 +346,9 @@ class Ha(object):
|
||||
self.dcs.manual_failover('', '', index=self.cluster.failover.index)
|
||||
|
||||
def process_unhealthy_cluster(self):
|
||||
if self.is_paused():
|
||||
return "No action due to paused state"
|
||||
|
||||
if self.is_healthiest_node():
|
||||
if self.acquire_lock():
|
||||
if self.cluster.failover:
|
||||
|
||||
@@ -900,7 +900,7 @@ $$""".format(name, ' '.join(options)), name, password, password)
|
||||
for slot in set(self._replication_slots) - set(slots):
|
||||
self.query("""SELECT pg_drop_replication_slot(%s)
|
||||
WHERE EXISTS(SELECT 1 FROM pg_replication_slots
|
||||
WHERE slot_name = %s)""", slot, slot)
|
||||
WHERE slot_name = %s AND NOT active)""", slot, slot)
|
||||
|
||||
# create new slots
|
||||
for slot in set(slots) - set(self._replication_slots):
|
||||
|
||||
Reference in New Issue
Block a user