There's more...

Do not confuse a major PostgreSQL upgrade with a minor one. While we can use the steps in this recipe to upgrade from 9.5.4 to 9.5.5 for example, we cannot use it to move from 9.5.5 to 9.6.0 or 9.6.1.

This is because an upgrade of that magnitude currently requires pg_upgrade or pg_dump. In either case, the newly upgraded PostgreSQL instance is actually a copy of the old database. Patroni relies on the PostgreSQL replication system to synchronize nodes. Since it's not possible to replicate between major PostgreSQL versions, Patroni can't integrate nodes with large version mismatches.

If we tried a similar tactic as outlined in this recipe and used pg_upgrade after moving the cluster leader to pg2, pg1 could never re-join the ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.