How I can update patroni cluster which is running in top of kubernetes (provisioned using helm charts)
Lets say that currently i have patroni running with pg 9.6, but in future i need to upgrade that to 9.7. How to do that? I do not see any instructions in this repo
Your question is not about Patroni, but about PostgreSQL. Patroni does not upgrade PostgreSQL.
If you need upgrade PostgreSQL you need stop all nodes in cluster. Manual upgrade and run new version.
Hi @zetab,
You can use the pause/resume mode in order to turn off automatic failovers on the cluster, stop the postgres on the master pod, run pg_upgrade there, then start your postgres (with the new version) and then running resume. There will be two things to fix afterwards:
bindir inside the environment variable SPILO_CONFIGURATION) should be updated manually. After the statefulset is updated, all pods will reinitialize with the new version. It will have no effect on a master (since you have already updated it and started with the new PostgreSQL version manually), but the replicas won't start because of the mismatch between the old old datadir and the new version of PostgreSQL. Therefore, the next step isThere could be some caveat, namely, postgresql.conf variables that has changed between 9.x and 10, or even names of the directories (pg_wal vs pg_xlog), so we would appreciate your feedback if you actually try to do it.
Ok, thanks for information!
Most helpful comment
Hi @zetab,
You can use the pause/resume mode in order to turn off automatic failovers on the cluster, stop the postgres on the master pod, run pg_upgrade there, then start your postgres (with the new version) and then running
resume. There will be two things to fix afterwards:bindirinside the environment variableSPILO_CONFIGURATION) should be updated manually. After the statefulset is updated, all pods will reinitialize with the new version. It will have no effect on a master (since you have already updated it and started with the new PostgreSQL version manually), but the replicas won't start because of the mismatch between the old old datadir and the new version of PostgreSQL. Therefore, the next step isThere could be some caveat, namely, postgresql.conf variables that has changed between 9.x and 10, or even names of the directories (pg_wal vs pg_xlog), so we would appreciate your feedback if you actually try to do it.