mirror of https://github.com/zulip/zulip.git
upgrade-postgresql: Ensure the new PostgreSQL is running.
If a previous attempt at an upgrade failed for some reason, the new PostgreSQL may be installed, and the conversion will succeed, but the new PostgreSQL daemon will not be running (Puppet does not force it to start). This causes the upgrade to fail when analyzing statistics, since the daemon isn't running. Explicitly start the new PostgreSQL; this does nothing in most cases, but will provider better resiliency when recovering from previous partial upgrades.
This commit is contained in:
parent
f1acc6433c
commit
62562eedf7
|
@ -53,6 +53,9 @@ SCRIPTS_PATH=$(grep -o "/var/log/postgresql/pg_upgradecluster-$UPGRADE_FROM-$UPG
|
||||||
# our configuration immediately
|
# our configuration immediately
|
||||||
crudini --set /etc/zulip/zulip.conf postgresql version "$UPGRADE_TO"
|
crudini --set /etc/zulip/zulip.conf postgresql version "$UPGRADE_TO"
|
||||||
|
|
||||||
|
# Make sure the new PostgreSQL is running
|
||||||
|
pg_ctlcluster "$UPGRADE_TO" main start
|
||||||
|
|
||||||
# Update the statistics
|
# Update the statistics
|
||||||
su postgres -c "/usr/lib/postgresql/$UPGRADE_TO/bin/vacuumdb --all --analyze-only --jobs 10"
|
su postgres -c "/usr/lib/postgresql/$UPGRADE_TO/bin/vacuumdb --all --analyze-only --jobs 10"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue