patroni.git / summary / log / commit / refs
commit db82a83eb4a3f2ec8f2489e1a01f8ad94deaecd1
Author: Alexander Kukushkin <cyberdemn@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Fri Aug 30 14:36:05 2024 +0000
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.
docs/releases.rst | 12 ++++++++++++
patroni/dcs/__init__.py | 3 ++-
patroni/version.py | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/releases.rst b/docs/releases.rst
index 7fab4249..2c42ea9a 100644
--- a/docs/releases.rst
+++ b/docs/releases.rst
@@ -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
-------------
diff --git a/patroni/dcs/__init__.py b/patroni/dcs/__init__.py
index b13d91a2..1185367c 100644
--- a/patroni/dcs/__init__.py
+++ b/patroni/dcs/__init__.py
@@ -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
diff --git a/patroni/version.py b/patroni/version.py
index ceb3b227..d716e607 100644
--- a/patroni/version.py
+++ b/patroni/version.py
@@ -2,4 +2,4 @@
:var __version__: the current Patroni version.
"""
-__version__ = '4.0.0'
+__version__ = '4.0.1'
[parent: 3ecdf01b5077]