diff --git a/patroni/ha.py b/patroni/ha.py index 3af5315e..5699be69 100644 --- a/patroni/ha.py +++ b/patroni/ha.py @@ -696,7 +696,7 @@ class Ha(object): return global_config.is_synchronous_mode def is_quorum_commit_mode(self) -> bool: - """:returns: `True` if quorum commit replication is requested and "supported".""" + """``True`` if quorum commit replication is requested and "supported".""" return global_config.is_quorum_commit_mode and self.state_handler.supports_multiple_sync def is_failsafe_mode(self) -> bool: @@ -730,8 +730,8 @@ class Ha(object): def _process_quorum_replication(self) -> None: """Process synchronous replication state when quorum commit is requested. - Synchronous standbys are registered in two places postgresql.conf and DCS. The order of updating them must - keep the invariant that `quorum + sync >= len(set(quorum pool)|set(sync pool))`. This is done using + Synchronous standbys are registered in two places: ``postgresql.conf`` and DCS. The order of updating them must + keep the invariant that ``quorum + sync >= len(set(quorum pool)|set(sync pool))``. This is done using :class:`QuorumStateResolver` that given a current state and set of desired synchronous nodes and replication level outputs changes to DCS and synchronous replication in correct order to reach the desired state. In case any of those steps causes an error we can just bail out and let next iteration rediscover the state @@ -874,7 +874,7 @@ class Ha(object): we can promote immediately and let normal quorum resolver process handle any membership changes later. Otherwise, we will just reset DCS state to ourselves and add replicas as they connect. - :returns: `True` if on success or `False` if failed to update /sync key in DCS. + :returns: ``True`` if on success or ``False`` if failed to update /sync key in DCS. """ if not self.is_synchronous_mode(): self.disable_synchronous_replication() @@ -1120,7 +1120,7 @@ class Ha(object): :param wal_position: Current wal position. - :returns `True` when node is lagging + :returns: ``True`` when node is lagging """ lag = (self.cluster.last_lsn or 0) - wal_position return lag > global_config.maximum_lag_on_failover @@ -1131,7 +1131,7 @@ class Ha(object): :param members: the list of nodes to check against :param check_replication_lag: whether to take the replication lag into account. If the lag exceeds configured threshold the node disqualifies itself. - :returns: `True` if the node is eligible to become the new leader. Since this method is executed + :returns: ``True`` if the node is eligible to become the new leader. Since this method is executed on multiple nodes independently it is possible that multiple nodes could count themselves as the healthiest because they received/replayed up to the same LSN, but this is totally fine. diff --git a/patroni/quorum.py b/patroni/quorum.py index 120c5e0d..059c8acc 100644 --- a/patroni/quorum.py +++ b/patroni/quorum.py @@ -253,7 +253,7 @@ class QuorumStateResolver: break def __handle_non_steady_cases(self) -> Iterator[Transition]: - """Handle cases when set of transitions produces on previous run was interrupted. + """Handle cases when set of transitions produced on previous run was interrupted. :yields: transitions as :class:`Transition` objects. """