mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix bug in member slots retention feature (#3142)
If `name` contains upper case or special characters the node was creating unused replication slot for itself.
This commit is contained in:
@@ -3,6 +3,18 @@
|
|||||||
Release notes
|
Release notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
Version 4.0.1
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released 2024-08-30
|
||||||
|
|
||||||
|
**Bugfix**
|
||||||
|
|
||||||
|
- Patroni was creating unnecessary replication slots for itself (Alexander Kukushkin)
|
||||||
|
|
||||||
|
It was happening if ``name`` contains upper-case or special characters.
|
||||||
|
|
||||||
|
|
||||||
Version 4.0.0
|
Version 4.0.0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|||||||
@@ -1170,8 +1170,9 @@ class Cluster(NamedTuple('Cluster',
|
|||||||
# `max` is only a fallback so we take the LSN from the slot when there is no feedback from the member.
|
# `max` is only a fallback so we take the LSN from the slot when there is no feedback from the member.
|
||||||
lsn = max(member.lsn or 0, lsn)
|
lsn = max(member.lsn or 0, lsn)
|
||||||
ret[slot_name] = {'type': 'physical', 'lsn': lsn}
|
ret[slot_name] = {'type': 'physical', 'lsn': lsn}
|
||||||
|
slot_name = slot_name_from_member_name(name)
|
||||||
ret.update({slot: {'type': 'physical'} for slot in self.status.retain_slots
|
ret.update({slot: {'type': 'physical'} for slot in self.status.retain_slots
|
||||||
if slot not in ret and slot != name})
|
if slot not in ret and slot != slot_name})
|
||||||
|
|
||||||
if len(ret) < len(members):
|
if len(ret) < len(members):
|
||||||
# Find which names are conflicting for a nicer error message
|
# Find which names are conflicting for a nicer error message
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
:var __version__: the current Patroni version.
|
:var __version__: the current Patroni version.
|
||||||
"""
|
"""
|
||||||
__version__ = '4.0.0'
|
__version__ = '4.0.1'
|
||||||
|
|||||||
Reference in New Issue
Block a user