Skip to content

Commit

Permalink
Silence pg_upgrade check warning for debian-9
Browse files Browse the repository at this point in the history
The failure warning about postgres cannot execute snags us in our tests but
is fine because we proceed to upgrade in a different way during upgrade.

Ticket: ENT-10710
Changelog: none
  • Loading branch information
craigcomstock committed Oct 12, 2023
1 parent ddd8338 commit 7bb2643
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packaging/common/cfengine-hub/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -701,13 +701,15 @@ do_migration() {
cf_console echo "Migration using pg_upgrade failed."
# skip ubuntu-16 and debian-9 since there is an expected failure there
# check for "/var/cfengine/state/pg/backup/bin/postgres" failed: cannot execute
if [ \( "$BUILT_ON_OS" != "ubuntu" -a "$BUILT_ON_OS_VERSION" != "16" \) -a
\( "BUILT_ON_OS" != "debian" -a "$BUILT_ON_OS_VERSION" != "9" \) ]; then
if [[ ( "$BUILT_ON_OS" = "ubuntu" && "$BUILT_ON_OS_VERSION" = "16" ) || \
( "$BUILT_ON_OS" = "debian" && "$BUILT_ON_OS_VERSION" = "9" ) ]]; then
true # no-op
else
# 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
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
Expand Down

0 comments on commit 7bb2643

Please sign in to comment.