Skip to content

Commit 73d276d

Browse files
committed
Add instrumentation logging
1 parent e3dc89f commit 73d276d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

patroni/dcs/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,17 @@ def get_replication_slots(self, postgresql: 'Postgresql', member: Tags, *,
10551055

10561056
slots: Dict[str, Dict[str, Any]] = self._get_members_slots(name, role,
10571057
member.nofailover, postgresql.can_advance_slots)
1058+
logger.info('Member slots: %s', slots)
1059+
10581060
permanent_slots: Dict[str, Any] = self._get_permanent_slots(postgresql, member, role)
10591061

1062+
logger.info('Permanent slots: %s', permanent_slots)
1063+
10601064
disabled_permanent_logical_slots: List[str] = self._merge_permanent_slots(
10611065
slots, permanent_slots, name, role, postgresql.can_advance_slots)
10621066

1067+
logger.info('After merging: %s', slots)
1068+
10631069
if disabled_permanent_logical_slots and show_error:
10641070
logger.error("Permanent logical replication slots supported by Patroni only starting from PostgreSQL 11. "
10651071
"Following slots will not be created: %s.", disabled_permanent_logical_slots)

patroni/postgresql/slots.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ def sync_replication_slots(self, cluster: Cluster, tags: Tags) -> List[str]:
572572

573573
slots = cluster.get_replication_slots(self._postgresql, tags, show_error=True)
574574

575+
logger.info('sync_replication_slots(): Slots fetched from DCS: %s', slots)
576+
575577
self._drop_incorrect_slots(cluster, slots)
576578

577579
# We don't want to clean physical replication slots with xmin feedback if:

0 commit comments

Comments
 (0)