Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-30070

Satellite upgrade of Postgres 12 to 13 fails if`/var/lib/pgsql/data` is a direct mount

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • rubygem-foreman_maintain-1.9.2
    • 0
    • Platform
    • To Do

      Problem Statement

      If /var/lib/pgsql/data is a direct mount on a Satellite 6.15 server, the upgrade to the 6.16 release fails with the following error logged in /var/log/foreman-installer/satellite.log:

      2024-12-10 11:58:18 [NOTICE] [pre] Migrating PostgreSQL data
      2024-12-10 11:58:18 [DEBUG ] [root] Executing: sed -i '/^data_directory/d' /var/lib/pgsql/data/postgresql.conf
      2024-12-10 11:58:18 [DEBUG ] [root] Executing: runuser -l postgres -c 'PGSETUP_INITDB_OPTIONS="--lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --locale=en_US.UTF-8" postgresql-setup --upgrade'
      2024-12-10 11:58:19 [DEBUG ] [root] WARNING: Note that either your data directory '/var/lib/pgsql/data' or
      2024-12-10 11:58:19 [DEBUG ] [root]          the parent directory '/var/lib/pgsql'
      2024-12-10 11:58:19 [DEBUG ] [root]          is a direct mountpoint.  This is usually a bad idea and your
      2024-12-10 11:58:19 [DEBUG ] [root]          filesystem layout should ideally look like:
      2024-12-10 11:58:19 [DEBUG ] [root]          /ROOT_OWNED_MOUNTPOINT/POSTGRES_OWNED_DIRECTORY/DATADIR.
      2024-12-10 11:58:19 [DEBUG ] [root]          See the upstream documentation for more info:
      2024-12-10 11:58:19 [DEBUG ] [root]          http://www.postgresql.org/docs/13/static/creating-cluster.html
      2024-12-10 11:58:19 [DEBUG ] [root] mv: cannot move '/var/lib/pgsql/data' to '/var/lib/pgsql/data-old': Device or resource busy
      2024-12-10 11:58:19 [ERROR ] [root] runuser -l postgres -c 'PGSETUP_INITDB_OPTIONS="--lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --locale=en_US.UTF-8" postgresql-setup --upgrade' failed! Check the output for error!
      2024-12-10 11:58:19 [DEBUG ] [pre_exit] Hook /usr/share/foreman-installer/hooks/pre_exit/20-certs_regenerate.rb returned nil
      2024-12-10 11:58:19 [DEBUG ] [root] Exit with status code: 1 (signal was 1)
      2024-12-10 11:58:19 [DEBUG ] [root] Cleaning /tmp/kafo_installation20241210-1330666-14u4tg
      2024-12-10 11:58:19 [DEBUG ] [root] Cleaning /tmp/default_values.yaml
      2024-12-10 11:58:19 [DEBUG ] [root] Installer finished in 30.151916677 seconds 

      User Experience & Workflow

      To avoid hitting this situation, we need to implement a mechanism to check if /var/lib/pgsql/data is a direct mount or not before performing the upgrade, and if it is, inhibit the upgrade.

      Requirements

      • Guarantee that the correct mount point is used during the Satellite pre-upgrade check as well as the upgrade run.
      • If an incorrect (unexpected) mount point is detected, inhibit the upgrade.
      • Block the ability of a user to white-list this check, as doing so results in a failed upgrade.

      Business Impact

      Customers will continue to end up with failed upgrades if incorrect mount points are in use.

              egolov@redhat.com Evgeni Golov
              rhn-support-momran Mohamed Omran
              Jameer Pathan Jameer Pathan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: