zalando / spilo

Highly available elephant herd: HA PostgreSQL cluster using Docker
Apache License 2.0
1.51k stars 371 forks source link

Question on major upgrade procedure #970

Closed rodinasophie closed 4 months ago

rodinasophie commented 4 months ago

Dear Zalando Team,

I'm searching for a correct generic major upgrade procedure for patroni/postgresql and I've found the script for spilo major upgrade - https://github.com/zalando/spilo/blob/9091d782c3965b7a8c17ef2919f404a50685ce09/postgres-appliance/major_upgrade/inplace_upgrade.py#L623

Could you please explain, why do you run the update_extensions() procedure after the major upgrade procedure? How do you handle the situations when, for example, some old extension version is not supported for the new postgresql cluster? pg_upgrade should fail in this case and update extension procedure seems to be run before the pg_upgrade.

hughcapet commented 4 months ago

Which specific extension do you mean by "some old extension version is not supported for the new postgresql cluster"? Extensions should provide upgrade path from any older version to the newer ones.

Timescale case is unique in this sense - older versions of PG are not supported by the newer TS versions, while older TS versions are not provided for the newer PG versions. In this case you need to perform PG major upgrade through an intermediate PG version (official guideline from timescale). But here actually upgrade fails on earlier stages - during the pg_upgrade --check run, due to the absence of the required loadable libraries for the new (target) PG version.

rodinasophie commented 4 months ago

Thank you for the answer, timescaledb example is what I was talking about.