How it works...
Before we explain the steps of this recipe, we want to mention that none of this process is actually necessary except for killing the patroni daemon on the node we're upgrading. If we stop Patroni on pgha1, the cluster will eventually notice and elect a new leader without our direct intervention. However, depending on our timeout settings, the cluster may remain without a leader for several seconds. This recipe ensures the cluster is never without a primary server and is always writable.
Otherwise, our first step is to start a monitor on pgha3 since it will be upgraded last. This allows us to see which node is the current leader and any transition states while we upgrade the other two systems. This is important since pgha1 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access