From 3bf7095eadf15ae0228d62a6c445638b9b24ec46 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 26 Jul 2023 07:56:32 +0200 Subject: [PATCH] Address review feedback --- patroni/postgresql/sync.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/patroni/postgresql/sync.py b/patroni/postgresql/sync.py index 8716ad8c..f37a8feb 100644 --- a/patroni/postgresql/sync.py +++ b/patroni/postgresql/sync.py @@ -226,7 +226,8 @@ END;$$""") .. note:: Tuples are reverse ordered by ``sync_state`` and LSN fields so nodes that already synchronous or having - higher LSN values are preferred. + higher LSN values are preferred. Replicas that are streaming, but don't have ``running`` ``state`` + or tagged with ``nofailover`` tag in DCS are skipped. :param cluster: current cluster topology from DCS. @@ -262,7 +263,12 @@ END;$$""") yield (pid, member.name, sync_state, replica_lsn, bool(member.nofailover)) def _process_replica_readiness(self, cluster: Cluster, replica_list: List[Tuple[int, str, str, int, bool]]) -> None: - """Flags replicas as truly "synchronous" when they caught up with "_primary_flush_lsn".""" + """Flags replicas as truly "synchronous" when they caught up with "_primary_flush_lsn". + + :param cluster: current cluster topology from DCS + :param replica_list: the list of tuples returned from :func:``_get_replica_list`` method + (represents replication connections) that we want to evaluate. + """ if TYPE_CHECKING: # pragma: no cover assert self._postgresql.global_config is not None for pid, app_name, sync_state, replica_lsn, _ in replica_list: