Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions services/upgrade/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function handle_master_upgrade() {

ls -la $MIGRATION_PATH

set +e
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we have to use set +e in the end of check_user function to rollback set -e

echo "[$(date +%Y-%m-%dT%H:%M:%S)] Check cluster before upgrade"
/usr/lib/postgresql/"${PG_VERSION_TARGET}"/bin/pg_upgrade \
--old-datadir "/var/lib/pgsql/data/${DATA_DIR}" \
Expand All @@ -110,6 +111,7 @@ function handle_master_upgrade() {
> /var/lib/pgsql/data/check_result

CHECK_CODE=$?
set -e

if [[ "$CHECK_CODE" -ne 0 ]]; then
echo "[$(date +%Y-%m-%dT%H:%M:%S)] Check cluster before upgrade - Failed."
Expand Down Expand Up @@ -244,8 +246,8 @@ check_pgsql_version

if [[ "${TYPE}" == "master" ]]; then
handle_master_upgrade
exit $?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant as we use exit inside

elif [[ "${TYPE}" == "replica" ]]; then
handle_replica_upgrade
exit $?
fi

exit 0
Loading