From 74ed88611f0039f2de5d4c0c409533628eb4ba10 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 17 Aug 2023 13:27:59 +0200 Subject: [PATCH] Please sphinx --- patroni/postgresql/citus.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patroni/postgresql/citus.py b/patroni/postgresql/citus.py index fcfcd2b8..58139e22 100644 --- a/patroni/postgresql/citus.py +++ b/patroni/postgresql/citus.py @@ -159,20 +159,22 @@ class PgDistGroup(Set[PgDistNode]): """Compares this topology with the old one and yields transitions that transform the old to the new one. .. note:: - In addition to the yielding transactions this method fills up *nodeid* attribute for nodes that are presented in the old and in the new topology. There are a few simple rules/constraints that are imposed by Citus and must be followed: - adding/removing nodes is only possible when metadata is synced to all registered "priorities". + - the "primary" row in "pg_dist_node" always keeps the nodeid (unless it is removed, but it is not supported by Patroni). + - "nodename", "nodeport" must be unique across all rows in the "pg_dist_node". + - updating "broken" nodes always works and metadata is synced asynchnonously after commit. Following these rules below is an example of the switchover between node1 (primary) and node2 (secondary). - :Example: + .. code-block:: SQL BEGIN; SELECT citus_update_node(4, 'node1-demoted', 5432); @@ -181,6 +183,7 @@ class PgDistGroup(Set[PgDistNode]): COMMIT; :param old: the last know topology registered in "pg_dist_node" for a given *group* + :yields: :class:`PgDistNode` objects that must be updated/added/removed in "pg_dist_node". """ self.failover = old.failover