mirror of
https://github.com/optim-enterprises-bv/patroni.git
synced 2025-12-30 18:30:47 +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:
committed by
GitHub
parent
3ecdf01b50
commit
db82a83eb4
@@ -3,6 +3,18 @@
|
||||
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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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.
|
||||
lsn = max(member.lsn or 0, 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
|
||||
if slot not in ret and slot != name})
|
||||
if slot not in ret and slot != slot_name})
|
||||
|
||||
if len(ret) < len(members):
|
||||
# Find which names are conflicting for a nicer error message
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
:var __version__: the current Patroni version.
|
||||
"""
|
||||
__version__ = '4.0.0'
|
||||
__version__ = '4.0.1'
|
||||
|
||||
Reference in New Issue
Block a user