Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
upgrade-postgresql: Only try to start new cluster if it is stopped.
Alex Vandiver7e637786b3e3
diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresqlindex 3302cac04d9..51a0f897d57 100755--- a/scripts/setup/upgrade-postgresql+++ b/scripts/setup/upgrade-postgresql@@ -59,7 +59,14 @@ SCRIPTS_PATH=$(grep -o "/var/log/postgresql/pg_upgradecluster-$UPGRADE_FROM-$UPGcrudini --set /etc/zulip/zulip.conf postgresql version "$UPGRADE_TO"# Make sure the new PostgreSQL is running-pg_ctlcluster "$UPGRADE_TO" main start+start_main_cluster="$(+ pg_lsclusters --json \+ | jq --arg pg_version "$UPGRADE_TO" -r \+ '.[] | select((.version|tostring == $ARGS.named.pg_version) and (.cluster == "main") and (.running != 1)) | .cluster'+)"+if [ -n "$start_main_cluster" ]; then+ pg_ctlcluster "$UPGRADE_TO" main start+fi# Update the statisticssu postgres -c "/usr/lib/postgresql/$UPGRADE_TO/bin/vacuumdb --all --analyze-only --jobs 10"