Skip to content

Commit 74c0acf

Browse files
authored
Fix issue with mixed setups: primary on pre-v4 and replicas on v4+ (patroni#3181)
Reported in patroni#3171
1 parent 58ee52b commit 74c0acf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

patroni/dcs/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,12 +1199,13 @@ def replica_filter(member: Member) -> bool:
11991199
else:
12001200
members = [m for m in members if expected_active(m)]
12011201

1202+
leader_patroni_version = self.leader and self.leader.member.patroni_version
12021203
slots: Dict[str, int] = self.slots
12031204
ret: Dict[str, Dict[str, Any]] = {}
12041205
for member in members:
12051206
slot_name = slot_name_from_member_name(member.name)
12061207
lsn = slots.get(slot_name, 0)
1207-
if member.replicatefrom:
1208+
if member.replicatefrom or leader_patroni_version and leader_patroni_version < (4, 0, 0):
12081209
# `/status` key is maintained by the leader, but `member` may be connected to some other node.
12091210
# In that case, the slot in the leader is inactive and doesn't advance, so we use the LSN
12101211
# reported by the member to advance replication slot LSN.

0 commit comments

Comments
 (0)