Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzOpI-0002x8-7Z for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Sep 2018 16:14:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fzOpG-0003X7-9b for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Sep 2018 16:14:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzOpF-0003X0-W8 for pgsql-bugs@lists.postgresql.org; Mon, 10 Sep 2018 16:14:10 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fzOpD-000172-1f for pgsql-bugs@lists.postgresql.org; Mon, 10 Sep 2018 16:14:08 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fzOpC-0005w5-7E; Mon, 10 Sep 2018 12:14:06 -0400 Date: Mon, 10 Sep 2018 12:14:06 -0400 From: Bruce Momjian To: kalyani kaniganti Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15376: Postgres sql 9.4.19 pg_upgrade stops with error The source cluster was not shut down cleanly. Message-ID: <20180910161406.GB20064@momjian.us> References: <153650968546.23141.16889932223808209670@wrigleys.postgresql.org> <20180909222224.GA13949@momjian.us> <20180910021042.GA22703@momjian.us> <20180910041040.GB13949@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Sep 10, 2018 at 03:45:15PM +0530, kalyani kaniganti wrote: > HI Bruce, > > We are using below command for an upgrade and after executing the below command > the status is returning with the cluster error. >  /opt/postgres/9.4/bin/pg_upgrade -b /usr/bin -B /opt/postgres/9.4/bin -d data path> -D >  rc=$? > Rc returns the mentioned error. > > When we check with pg_ctl status command output is showing as server not > running. > > How can we check the database cluster is shut down using which command.Can you > share us the details other than the pg_ctl.bR  Sure. A running server shows this: $ pg_controldata /u/pg/data pg_control version number: 1100 Catalog version number: 201809052 Database system identifier: 6598932306319366658 --> Database cluster state: in production pg_control last modified: Sat 08 Sep 2018 03:12:38 PM EDT A shut down server looks like this: $ pg_controldata /u/pg/data pg_control version number: 1100 Catalog version number: 201809052 Database system identifier: 6598932306319366658 --> Database cluster state: shut down pg_control last modified: Mon 10 Sep 2018 12:09:29 PM EDT If is says "shut down in recovery" then it is in standby mode and cannot be used by pg_upgrade directly, only via rsync. --------------------------------------------------------------------------- > kalyani > > > > > On Mon, Sep 10, 2018 at 9:40 AM Bruce Momjian wrote: > > On Mon, Sep 10, 2018 at 09:30:28AM +0530, kalyani kaniganti wrote: > > Hi Bruce, > > Thanks for the immediate reply. > > We are using pg_ctl command to shutdown the old server with no option.In > this > > case the pg_ctl will consider as smart shutdown if no option is specified > as > > per documentation . > > please find bellow command. > > /bin/pg_ctl -D stop  > > Yes, this should be fine. > > > We are using the same script for multiple releases in Postgres sql to > upgrade > > the database from 9.1 to 9.4 . > > Same script is working fine in 9.4.17 version, while upgrading DB from > 9.1 to > > 9.4.17. > > OK. > > > From the release notes of 9.4.19 version we did not find any changes done > on > > pg_upgrade except one bug fix related to pg_upgrade has been fixed. > > Do we have to add in our code to check for graceful shutdown or we have > to wait > > for the next release? > > Please let us know if you have any workaround till the next minor patch > is > > released. > > Well, there is nothing pending in the next beta except a better error > message text.  Can you show me the commands and the error you are > getting.  The system is looking at the output from: > >         $ pg_controldata $PGDATA > > The "Database cluster state:" must be "shut down" before running > pg_upgrade. > > -- >   Bruce Momjian          http://momjian.us >   EnterpriseDB                             http://enterprisedb.com > > + As you are, so once was I.  As I am, so you will be. + > +                      Ancient Roman grave inscription + > -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +