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 1g08Cq-0007mp-Si for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Sep 2018 16:41:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g08Cp-0003qN-Bc for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Sep 2018 16:41:31 +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 1g08Cp-0003qF-2B for pgsql-bugs@lists.postgresql.org; Wed, 12 Sep 2018 16:41:31 +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 1g08Cm-0000lx-DE for pgsql-bugs@lists.postgresql.org; Wed, 12 Sep 2018 16:41:29 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1g08Ck-0003tW-TQ; Wed, 12 Sep 2018 12:41:26 -0400 Date: Wed, 12 Sep 2018 12:41:26 -0400 From: Bruce Momjian To: Michael Paquier Cc: kalyani kaniganti , 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: <20180912164126.GC24251@momjian.us> References: <20180910174823.GD20064@momjian.us> <20180911023439.GA27769@momjian.us> <20180911161842.GL20064@momjian.us> <20180912022744.GE25160@paquier.xyz> <20180912134804.GA19769@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180912134804.GA19769@momjian.us> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Sep 12, 2018 at 09:48:04AM -0400, Bruce Momjian wrote: > On Wed, Sep 12, 2018 at 11:27:44AM +0900, Michael Paquier wrote: > > On Wed, Sep 12, 2018 at 06:51:44AM +0530, kalyani kaniganti wrote: > > > I have a query,in our case old db is not getting shutdown cleanly .May I > > > know why the DB is unable to shutdown cleanly and this happens repeatedly > > > .How we can recover the cluster state going to in production state after > > > stopping the cluster. > > > > If one of your PostgreSQL instances is not able to stop, its logs would > > tell you what it did not have time to finish. You may perhaps blame the > > time it takes for the shutdown checkpoint to finish. You should also > > try to use the fast mode of "pg_ctl stop", which makes sure that all > > sessions connected are forcibly finished cleanly, allowing Postgres to > > not need crash recovery the next time it starts. > > Oh, I never suspected it was a timing issue. Use pg_ctl -w to wait for > the shutdown. The default for wait has changed over time. I will add > -w to the pg_upgrade manual page example using pg_ctl for stopping the > server. OK, so I looked into this and "wait/-w" has been the default action for pg_ctl stop since at least PG 9.1, which is what the person was reporting: if (!wait_set) { switch (ctl_command) { case RESTART_COMMAND: case START_COMMAND: do_wait = false; break; case STOP_COMMAND: do_wait = true; break; default: break; } } Are they using pg_ctl -W earlier? I don't know because the reporter is not providing answers to my questions. I don't think it makes sense for me to keep trying to guess the cause of this. -- 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 +