Skip to content

Commit

Permalink
Fixed issue with using pg_upgrade on ubuntu-16 hub installer upgrade
Browse files Browse the repository at this point in the history
Issue is that ubuntu-16 has problems with pg_upgrade due to backup/bin/postgres
"cannot execute" during it's checks.
This is fine since we have other ways to migrate that work.

Ticket: ENT-10710
Changelog: title
  • Loading branch information
craigcomstock committed Sep 29, 2023
1 parent 1885181 commit 0173c0f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packaging/common/cfengine-hub/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,15 @@ do_migration() {
exit 0 # exits only from (...)
fi
cf_console echo "Migration using pg_upgrade failed."
# here pg_upgrade probably said something like
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
cf_console echo "Showing last lines of any related log files:"
_daysearch=$(date +%Y%m%d)
find "$PREFIX"/state/pg/data/pg_upgrade_output.d -name *.log | grep "$_daysearch" | cf_console xargs tail
# skip ubuntu-16 since there is an expected failure there
# check for "/var/cfengine/state/pg/backup/bin/postgres" failed: cannot execute
if [ "$BUILT_ON_OS" != "ubuntu" ] && [ "$BUILT_ON_OS_VERSION" != "16" ]; then
# here pg_upgrade probably said something like
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
cf_console echo "Showing last lines of any related log files:"
_daysearch=$(date +%Y%m%d)
find "$PREFIX"/state/pg/data/pg_upgrade_output.d -name *.log | grep "$_daysearch" | cf_console xargs tail
fi
cf_console echo
check_disk_space # will abort if low on disk space
init_postgres_dir "$new_pgconfig_file" "$pgconfig_type"
Expand Down

0 comments on commit 0173c0f

Please sign in to comment.