Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5Qlw-0002Ap-6l for pgsql-general@arkaria.postgresql.org; Wed, 04 Sep 2019 08:36: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 1i5Qlu-0004OG-Lt for pgsql-general@arkaria.postgresql.org; Wed, 04 Sep 2019 08:36:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5Qlu-0004I5-9K for pgsql-general@lists.postgresql.org; Wed, 04 Sep 2019 08:36:10 +0000 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5Qlq-0001yE-Qx for pgsql-general@lists.postgresql.org; Wed, 04 Sep 2019 08:36:09 +0000 Received: from firost (unknown [IPv6:2a01:e35:2e57:d3a0:c786:a62f:a4aa:deda]) (Authenticated sender: ioguix) by smtp6-g21.free.fr (Postfix) with ESMTPSA id EDB8178038D; Wed, 4 Sep 2019 08:36:01 +0000 (UTC) Date: Wed, 4 Sep 2019 10:36:00 +0200 From: "Jehan-Guillaume (ioguix) de Rorthais" To: Nagendra Bandi Cc: pgsql-general@lists.postgresql.org Subject: Re: Postgres HA issue - Standby server does not start after Master compute host is shut down Message-ID: <20190904103600.6852e46c@firost> In-Reply-To: References: <20190903171347.7d1a9523@firost> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 3 Sep 2019 21:31:23 +0530 Nagendra Bandi wrote: > Hi Jehan, > Thanks for your quick response. > Standby is built from the primary using pg_basebackup. i.e. Initial copy of > the primary database is taken with pg_basebackup command pg_basebackup is supposed to make an non-exclusive backup, so this error shouldn't happen. Did you check the online backup actually succeed? > and then restarted the server. What is this server restart about? Do you restart the primary? Is it a simple startup of the standby? There something wrong somewhere in your procedure. Could you share your precise procedure steps please? > On Tue, Sep 3, 2019 at 8:43 PM Jehan-Guillaume (ioguix) de Rorthais < > ioguix@free.fr> wrote: > > > On Tue, 3 Sep 2019 20:27:37 +0530 > > Nagendra Bandi wrote: > > ... > > > *Problem Description :* > > > > > > PostgreSQL database is set up for High Availability and *asynchronous > > > streaming replication* with *hot standby* as described in > > > > > https://www.postgresql.org/docs/9.4/warm-standby.html#STREAMING-REPLICATION > > . > > > There is only 1 master and 1 standby server set up. The deployment is on > > > Openstack cloud where master database is running on one compute host and > > > standby server is running on another compute host. When master is brought > > > down (*compute host is powered off*), stand by is *not* able to take > > over. > > > The PostgreSQL database server on the standby fails to start with errors > > > messages given below. > > > > > > *Error logs from Standby Postgres DB:* > > > > > > *Logs form postgres log : > > > *< 2019-08-22 16:00:04.110 UTC >LOG: invalid record length at C/513BF150 > > > > > > < 2019-08-22 16:00:04.110 UTC >LOG: redo done at C/513BF118 > > > > > > < 2019-08-22 16:00:04.115 UTC >FATAL: WAL ends before end of online > > backup > > > > It looks like the standby never received the end of online backup record > > from > > the master. > > > > Could you describe how you built your standby? > > > > Regards, > > -- Jehan-Guillaume de Rorthais Dalibo