i search solution for upgrade databases from 9.6 to 10.0 without or near-zero downtime
i found suggestions like a https://blog.2ndquadrant.com/tag/pglupgrade/, but don't found any source code for this solution, could patroni kubernetes operator help me with this solution?
Hello @Slach
i search solution for upgrade databases from 9.6 to 10.0 without or near-zero downtime
It is possible if you use a recent Spilo image (relevant Spilo PR). Our OSS image already has it.
How much downtime you will have depends on your particular setup.
the support/docs from the operator will follow in the upcoming months
Please note that option is brand new and currently undergoes testing. @CyberDem0n may provide your with more information
Neither Patroni nor postgres-operator will do in place pg_upgrade for you.
What @sdudoladov is referring to is a major upgrade after creating a new cluster from basebackup.
Downtime in this case is significant and depends on the size of your cluster.
@CyberDem0n , can you please confirm:
while it is possible to modify the version under the postgresql crd, the upgrade won't take place, right?
The operator shows:
time="2019-02-27T13:07:36Z" level=warning msg="postgresql version change(\"9.6\" -> \"10\") has no effect" cluster-name=default/mycluster2 pkg=cluster worker=3
but unfortunately the cluster gets destabilized, trying to do something it cannot:
2019-02-27 13:10:11 UTC [83]: [1-1] 5c77ddb3.53 0 FATAL: database files are incompatible with server
2019-02-27 13:10:11 UTC [83]: [2-1] 5c77ddb3.53 0 DETAIL: The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.6 (Ubuntu 10.6-1.pgdg18.04+1).
/var/run/postgresql:5432 - no response
2019-02-27 13:10:11,982 INFO reaped unknown pid 83
2019-02-27 13:10:12,983 ERROR: postmaster is not running
2019-02-27 13:10:12,999 INFO: Lock owner: mycluster2-0; I am mycluster2-1
2019-02-27 13:10:12,999 INFO: failed to start postgres
2019-02-27 13:10:21,670 WARNING: Postgresql is not running.
It will not do an in-place major upgrade.
Thanks for confirmation on major versions change @CyberDem0n .
While the version is actually the folder name inside the spilo image, and the spilo image does not have minor versions for either 10 or 11, I understand that maximum possible are upgrades are between 9.3->9.6 minor versions (unless you confirm those are not supported either).
Nope, 9.3 to 9.6 is a Postgres Major version upgrade.
We do major version upgrades currently as part of clone/restore. So testable and usable and then for most apps this is fine as in and out is buffered.
My current strategy launches a secondary cluster with the updated version cloning the one to be updated, it seems to work but haven't done it in production
Questions seems to be answered. Feel free to reopen.
Most helpful comment
Neither Patroni nor postgres-operator will do in place pg_upgrade for you.
What @sdudoladov is referring to is a major upgrade after creating a new cluster from basebackup.
Downtime in this case is significant and depends on the size of your cluster.