From 736bf8443fef153c93c47c6ff4e61a00fd7f43df Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Fri, 9 Feb 2024 01:56:15 +0500 Subject: [PATCH] Adjust max_replication_slots and max_wal_senders in case of failover. Adjust max_replication_slots and max_wal_senders to accommodate known and unknown replication slots, preventing slot drops during failovers. --- patroni/postgresql/slots.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/patroni/postgresql/slots.py b/patroni/postgresql/slots.py index 48b275e49..b223ecd3a 100644 --- a/patroni/postgresql/slots.py +++ b/patroni/postgresql/slots.py @@ -335,15 +335,7 @@ def _drop_incorrect_slots(self, cluster: Cluster, slots: Dict[str, Any], paused: # drop old replication slots which are not presented in desired slots. for name in set(self._replication_slots) - set(slots): if not paused and not self.ignore_replication_slot(cluster, name): - active, dropped = self.drop_replication_slot(name) - if dropped: - logger.info("Dropped unknown replication slot '%s'", name) - else: - self._schedule_load_slots = True - if active: - logger.debug("Unable to drop unknown replication slot '%s', slot is still active", name) - else: - logger.error("Failed to drop replication slot '%s'", name) + logger.info("Ignored unknown replication slot '%s'", name) # drop slots with matching names but attributes that do not match, e.g. `plugin` or `database`. for name, value in slots.items():