mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix another issue with replication slots.
Do not try to create replication slots on the replica for the member that wants to replicate from it if the member's currently holds the master role. Remove a debug message.
This commit is contained in:
@@ -660,9 +660,9 @@ $$""".format(name, options), name, password, password)
|
||||
(m.replicatefrom is None or m.replicatefrom == self.name or
|
||||
not cluster.has_member(m.replicatefrom))]
|
||||
else:
|
||||
# only manage slots for replicas that want to replicate from this one
|
||||
slots = [m.name for m in cluster.members if m.replicatefrom == self.name]
|
||||
logger.info("setting replication slots for members {0}".format(slots))
|
||||
# only manage slots for replicas that replicate from this one, except for the leader among them
|
||||
slots = [m.name for m in cluster.members if m.replicatefrom == self.name and
|
||||
m.name != cluster.leader.name]
|
||||
# drop unused slots
|
||||
for slot in set(self.replication_slots) - set(slots):
|
||||
self.query("""SELECT pg_drop_replication_slot(%s)
|
||||
|
||||
Reference in New Issue
Block a user