Skip to content

Commit

Permalink
Get rid of the JOIN_PRIMARY state. (#796)
Browse files Browse the repository at this point in the history
* Get rid of the JOIN_PRIMARY state.

We still need to maintain backward compatibility of course, in case there is
an upgrade where one node is in JOIN_PRIMARY and then we want to be able to
continue working with the node.

Now, any node that reports JOIN_PRIMARY is unconditionnally assigned PRIMARY
instead, and we never assign JOIN_PRIMARY anymore. We still have some code
that matches the state in the group level FSM, and we keep the full compat
on the client side for the moment.

* Per review, preserve our WAIT_PRIMARY to PRIMARY transition.

* Per review, APPLY_SETTINGS is only required when replicationQuorum.
  • Loading branch information
DimCitus committed Sep 7, 2021
1 parent d5a73eb commit ec8f8d9
Show file tree
Hide file tree
Showing 9 changed files with 450 additions and 494 deletions.
9 changes: 7 additions & 2 deletions docs/failover-state-machine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ all the other nodes.

In the previous diagram we can see that we have a list of six states where
the application can connect to a read-write Postgres service: ``single``,
``wait_primary``, ``primary``, ``prepare_maintenance``, ``apply_settings``,
and ``join_primary``.
``wait_primary``, ``primary``, ``prepare_maintenance``, and ``apply_settings``.

Init
^^^^
Expand Down Expand Up @@ -111,6 +110,12 @@ allows the primary node to apply necessary changes to its HBA setup before
allowing the new node joining the system to run the ``pg_basebackup``
command.

.. important::

This state has been deprecated, and is no longer assigned to nodes. Any
time we would have used ``join_primary`` before, we now use ``primary``
instead.

Primary
^^^^^^^

Expand Down
8 changes: 4 additions & 4 deletions docs/tikz/arch-multi-standby.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ec8f8d9

Please sign in to comment.