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 1fvS87-0005GI-AD for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Aug 2018 18:57:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fvS85-0006JZ-DV for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Aug 2018 18:57:17 +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 1fvS84-0006JL-VM for pgsql-hackers@lists.postgresql.org; Thu, 30 Aug 2018 18:57:17 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvS80-00037V-Eh for pgsql-hackers@postgresql.org; Thu, 30 Aug 2018 18:57:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 914C54ED; Thu, 30 Aug 2018 14:57:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 30 Aug 2018 14:57:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=3Qyg3IBSd5K6C4qsZ/b8AQYxiCNbOwc+RK4n2BqXqrw=; b=w/MMH1JF XZVbMr9I4DniZ05vLHX67G1/cfPFhcNDRCG2yIGwRxtc7HdqfbRSJCJcczbw8WoL ELsgyLGPxwDs0TEQ+WBAX4BLWsDg8ebqJNvZB5oXM927EaKzS/346eXMXX05doKT Kd9UUigDHOExaY/STxeoX8GmsDrHvw1SVNoAZvpDrQGLEBlIoR3Dr8e8ac2Pi+IW Wa8od7k+naJtPVED4FbudmiO9GBqsLpuGEqvuEi2RL6ABdMlDecFd7tkdMn3JerF y/GdjpGR3rGuO/TiTFWZbNeBXoMx2hO1DBJKwTE46AZC8iOHEDVTJ69RVj45qnqb XPhxQTCX4QnRUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=3Qyg3IBSd5K6C4qsZ/b8AQYxiCNbO wc+RK4n2BqXqrw=; b=k9JVXHvlYsJnIGsCeWLOYwAyQijh9pNMPkNuFHv3Ky5B/ juyJ39oBx1Ylj2z1ZAz7XK80qqav/WQzIkTW+84AF+Od6A/REenTPSz0c4/KirYe T7HXhRK777QcFOeS4r0BWYPOqPY+ywHXZo4srtj9k94srYNu5FVaOP35kaaiOW1/ KuCjswNeTa5g5PcEVcdrkx4U4IjSSjIhMEATHwFT/Y87JQFK5XNLbPgrOJ39it1u TwRP+NXTolv/lDrPKVdMYfTjaEeHzgq6cpEpQ6byle0JasdwMkTQ1J3gK/lj1g8H m9As2Ejo9GOPu10smj2M6pM218drZ9w5MlZqh3ekQ== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (unknown [208.91.3.26]) by mail.messagingengine.com (Postfix) with ESMTPA id BD2851028D; Thu, 30 Aug 2018 14:57:07 -0400 (EDT) Date: Thu, 30 Aug 2018 11:57:05 -0700 From: Michael Paquier To: Alexander Kukushkin Cc: PostgreSQL-development , Alvaro Herrera , Dmitry Dolgov <9erthalion6@gmail.com>, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15346: Replica fails to start after the crash Message-ID: <20180830185705.GF15446@paquier.xyz> References: <20180829061723.GA5903@paquier.xyz> <20180829121051.GC5903@paquier.xyz> <20180829205436.GE5903@paquier.xyz> <20180830133911.GA15446@paquier.xyz> <20180830173435.GB15446@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jaoouwwPWoQSJZYp" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --jaoouwwPWoQSJZYp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 30, 2018 at 08:31:36PM +0200, Alexander Kukushkin wrote: > 2018-08-30 19:34 GMT+02:00 Michael Paquier : >> I have been struggling for a couple of hours to get a deterministic test >> case out of my pocket, and I did not get one as you would need to get >> the bgwriter to flush a page before crash recovery finishes, we could do >=20 > In my case the active standby server has crashed, it wasn't in the > crash recovery mode. That's what I meant, a standby crashed and then restarted, doing crash recovery before moving on with archive recovery once it was done with all its local WAL. > Minimum recovery ending location is AB3/4A1B3118, but at the same time > I managed to find pages from 0000000500000AB300000053 on disk (at > least in the index files). That could only mean that bgwriter was > flushing dirty pages, but pg_control wasn't properly updated and it > happened not during recovery after hardware crash, but while the > postgres was running before the hardware crash. Exactly, that would explain the incorrect reference. > The only possible way to recover such standby - cut off all possible > connections and let it replay all WAL files it managed to write to > disk before the first crash. Yeah... I am going to apply the patch after another lookup, that will fix the problem moving forward. Thanks for checking by the way. -- Michael --jaoouwwPWoQSJZYp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAluIPgEACgkQnvQgOdby QH1IGA/8Dtbb+gqfpWH5NyAK/nCPOvMTGvfG5Sy42TT3DOigKPR9XKoFG10wcKTh 8TaNGRWQ+KF6woJGq1OqfF4trRqSD8UBpnwqMKTlVNohONRYeWEbhCtwCnPXKefQ p4I5kRuPzqUjikBMpulkyrQJctT74tjxgFiMiL7o/vgOPyr2rO/mAkpIxfDdA2M2 Ul9Akem77GQThU8gcr9/hCeJ0rePgc9Qv087u6VCrT0iR1arBOdgdD2hqwxhUqFH RIiKMf0E+v2GaeYSU2t5U6Zfp3ojTzNY1iqbT7el96mu3AOhjzh8qTyzbwm63zkP O1emHaluvLGdZ+wR8swqExPXKOMD8ntukWvDNzqZ1wpqcV/wWqegMhqsBz3ZFx2w hGfoOYOveL7cT7VeMU/lb3nXh/arcBFAKDuih73GBfPYUUKmj408ZnW3FyQGBp8O XvS/K8aMw4V7DPJARqrJ0JJzKbwokeoK5JKqouzTESZii33JSQ1AgkaHX+ki4Ky+ RHrhePr0Sshz3B0B3urm1tyP0PBcdZnbpeebaApzbWWX7EddfVSThzsjK0HXEFGY Ct6+b1qhV6tigU0C3VOVpOlvWXmiOuRskIRFZWE7rrHPZX8LFoCO10vyulZjU3jg HxdCaugw3WjJt30oeDQOPCFsTNSRJMzGGNn9gKCGtRb9tIOw+kU= =FocU -----END PGP SIGNATURE----- --jaoouwwPWoQSJZYp--