ubicloud/spec/prog/postgres
shikharbhardwaj 56bf890ae2
Implement Prog::Postgres::UpgradePostgresResource
The Upgrade prog is responsible for matching the current Postgres
version to the desired version. If there is a mismatch (current <
desired), the Upgrade prog is launched and takes precedence over
Convergence.

Roughly, the Upgrade prog does the following:
1. Create a new "candidate standby" with the same version as the current
   one and wait for it to catch up.
2. Fence the current primary.
3. Upgrade the candidate standby to the desired version.
4. Switch the candidate to use a new timeline.
5. Take over from the current primary.
6. Prune any older version servers and exit. The convergence prog will
   take care of starting any new standbys needed.

In case anything fails, we delete the candidate standby and unfence the
primary to bring the database back. During the Upgrade health checking
is effectively disabled as the auto-recovery causes conflicts with the
several restarts of various versions on the candidate.
2025-09-15 19:41:58 +02:00
..
converge_postgres_resource_spec.rb Return back to provisioning servers if target is changed 2025-07-07 14:57:14 +03:00
postgres_resource_nexus_spec.rb Implement Prog::Postgres::UpgradePostgresResource 2025-09-15 19:41:58 +02:00
postgres_server_nexus_spec.rb Implement Prog::Postgres::UpgradePostgresResource 2025-09-15 19:41:58 +02:00
postgres_timeline_nexus_spec.rb Implement Prog::Postgres::UpgradePostgresResource 2025-09-15 19:41:58 +02:00
upgrade_postgres_resource_spec.rb Implement Prog::Postgres::UpgradePostgresResource 2025-09-15 19:41:58 +02:00