3

While trying to upgrade from 9.6 to 11.6 it is failing with this below error:

su - postgres -c '/usr/pgsql-11/bin/pg_upgrade -d /opt/collabnet/teamforge/var/pgsql/9.6/data -D /opt/collabnet/teamforge/var/pgsql/11/data -b /usr/pgsql-9.6/bin -B /usr/pgsql-11/bin'

Performing Consistency Checks

Checking cluster versions ok

The source cluster was not shut down cleanly. Failure, exiting

Ranjith
  • 31
  • 3
  • Are you trying to update it while it's up and running? – Nasir Riley Mar 24 '20 at 11:49
  • 1
    Same issue. And no. Server crashed. So shutdown was unclean. Rebuilding it the same version of postresql not available in repo so looking to upgrade the cluster. But alas claims it was not shut down cleanly. Which of course it was not. So what I need is was to clean up the state of the cluster. – Bernd Wechner May 07 '21 at 11:43

1 Answers1

0

Seems to be a bug reported here https://www.postgresql.org/message-id/CACAAi_6c4hhhxFnUnerrBsfkS1+9CFBt79ORgp_8m6+Snck0Qw@mail.gmail.com

AFAIK, If you still have application services interacting with the PG DB, the DB could be in a state where it was performing some Crud operation before it was shut down. I suspect the source database wasn't shut down properly. Steps to fix it.

  1. Stop the application services from talking to the PG database.
  2. Start the Postgres 9.6. Login to PSQL and check for any active connection other than 127.0.0.x.
  3. Stop the DB using

pg_ctl stop -D /opt/collabnet/teamforge/var/pgsql/9.6/data

  1. Also confirm the /opt/collabnet/teamforge/var/pgsql/9.6/data/postmaster.pid file doesn't exist.
  2. Stop the Postgres 9.6 and retry the pg_upgrade.
Vin
  • 1