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 1fv7UF-0001ER-En for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Aug 2018 20:54:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fv7UE-0007Y3-0h for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Aug 2018 20:54:46 +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 1fv7UD-0007Xn-N7 for pgsql-bugs@lists.postgresql.org; Wed, 29 Aug 2018 20:54:45 +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 1fv7UB-0006xp-7l for pgsql-bugs@lists.postgresql.org; Wed, 29 Aug 2018 20:54:44 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8C5EF4AF; Wed, 29 Aug 2018 16:54:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 29 Aug 2018 16:54:41 -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=Teay0E2RRMSWUcjNvPQGJQ0dVB2T3+BIzt7AK+rfUzQ=; b=U7WvNt25 AH4ln0val5WrcnouUy/xJPFcnEWylJSBI0/DgXH14eTwWl9nI0GN9vZ1QT3rXvA1 7S3TFcjuDQ5y7P3ZRnh/XJrnlx8z8e9Hg6+0JFgaEy4PfgTrn2gaXiSdvn12a1Bj 27kFKHridI95Tn5hYDj5ErMq4+vr0GavkZLUH68ln/8fS98kEhmjGc2qMQG7w39b 5kw3QSjwPO1hSNgLwUbJ8rmsf41kvcVVqVe36Op5jEd9jku/G+L8q0SAteH8U8/E JC9ogRzsWDJ4YQt6EgfYpXPCixUjcEKDtsteAdVAzyifRtQ2SMXVDAGkapmT7TcT C8sm5IoAF41DMQ== 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=Teay0E2RRMSWUcjNvPQGJQ0dVB2T3 +BIzt7AK+rfUzQ=; b=LxImdIWAkGJ+vwev4GCXNe1T+8wo4Yz8iulyq2rp2LZA+ jgW9V8Di2+oEeZiHD++LweBU6byKi+rpp20YELoy0+my0x95XwcoSzwderawnobu 7ojhE31TFpYpXkdrFlfHMbQTMDic1uY+dlX9XD5UE4yDWqtBdLKrDlzxURGtaOnF sJuHXoEWrHoR0YRfAAo7WUzUuuTXSlUCNpMJD3Ao5uM7bZZulXUqwfYvseB11xft rozpFpvdTSSkglJ3I5wosOjPsgT5Spdkq0cIMC20lVu7vvTJQbblwpetfwPZs26E SfcQA2Q3QK9vbAGOWkLT2RfEb7/g0kPaMePC/dm6g== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (unknown [208.91.3.26]) by mail.messagingengine.com (Postfix) with ESMTPA id 4CF4210291; Wed, 29 Aug 2018 16:54:39 -0400 (EDT) Date: Wed, 29 Aug 2018 13:54:36 -0700 From: Michael Paquier To: Alexander Kukushkin Cc: 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: <20180829205436.GE5903@paquier.xyz> References: <20180822175034.lnvwk5js32k6mjyz@alvherre.pgsql> <20180823041420.GA1158@paquier.xyz> <20180829061723.GA5903@paquier.xyz> <20180829121051.GC5903@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Yb+qhiCg54lqZFXW" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Yb+qhiCg54lqZFXW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 29, 2018 at 03:05:25PM +0200, Alexander Kukushkin wrote: > BTW, I am thinking that we should return InvalidTransactionId from the > btree_xlog_delete_get_latestRemovedXid if the index page we read from > disk is newer then xlog record we are currently processing. Please see > the patch attached. This is not a solution in my opinion, as you could invalidate activities of backends connected to the database when the incorrect consistent point allows connections to come in too early. What happens if you replay with hot_standby = on up to the latest point, without any concurrent connections, then issue a checkpoint on the standby once you got to a point newer than the complain, and finally restart the standby with the bgworker? Another idea I have would be to make the standby promote, issue a checkpoint on it, and then use pg_rewind as a trick to update the control file to a point newer than the inconsistency. As PG < 9.6.10 could make the minimum recovery point go backwards, applying the upgrade after the consistent point got to an incorrect state would trigger the failure. -- Michael --Yb+qhiCg54lqZFXW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAluHCAwACgkQnvQgOdby QH20hg/9GpQK0+mnBVPOh2qpJbD7gSSUPueBgvArZBteN72yTYspalPOcsUuhm2h 0/jN3ivrs+wFO7RQxdsBXOsR1xWS/hxcGYECsUrMHTRAJPmcW5D+5P95B3fq0GsV WGSiR54v7gdlTN2YJ7x07BVEGV3zuL0FqKqzo8+dKECpKFQ/fmXKBsgMnERTRS0W FuRnT2tptJ1h2Kn5yOkIimisiKTbtwd/F1hnmvm977bMPdn2WDoLQSSSspcxSMSE LKJlKfnReTfpeQlFZNuf0ZZZAx8T3bgzAapgjtUDIon2yHK4a27d/74X3T3LulLM KTV4RNR1t5tzsdlwvZ1huNFcTpQLmUKog3fmQwyEo4fYQeyYETJsLA7i+uEz+6Ce lkhgwhooqvYKJDQMNA36OGNy3GHkd9A9A+LS2A1vmMPNveRotje/DIMyJCBXoscX LgblsQ1gV4+Wic+9HQtYhGdg82Bg1uDeCSxHdDm9dZJ5J/ygPZpe26kC2l4ItKay 5lrs3ZX3I9/Q8xkGWjf5Zs5x6Red3mCUUgd3Ll9J1qZbt7UcMDMr9xwTYOBnPt5A FCs1/KA2vZHYUaECWJL18On6x0T+hkhtOAg90ZXK2z6B0263oJFM+q4g2QS6gRUD XbesxF5yxBnJJoWSTXdGbSDw3NDc1l1GRZ/dSIqIvYsbiigBKxc= =+TKT -----END PGP SIGNATURE----- --Yb+qhiCg54lqZFXW--