Avoid unnecessary updates of /status key (#2782)

When we don't have permanent logical slots Patroni was updating the `/status` on every heart-beat loop even when LSN on the primary isn't moving forward.

The issue was introduced in the #2485
This commit is contained in:
Alexander Kukushkin
2023-07-27 13:38:24 +02:00
committed by GitHub
parent 238aba3956
commit 384a2a4d8f

View File

@@ -1033,7 +1033,9 @@ class AbstractDCS(abc.ABC):
raise
self._last_seen = int(time.time())
self._last_status = {self._OPTIME: cluster.last_lsn, 'slots': cluster.slots}
self._last_status = {self._OPTIME: cluster.last_lsn}
if cluster.slots:
self._last_status['slots'] = cluster.slots
self._last_failsafe = cluster.failsafe
with self._cluster_thread_lock: