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 1futnY-0006Vi-2V for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Aug 2018 06:17:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1futnT-00009j-VL for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Aug 2018 06:17:43 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1futnR-00009c-I5 for pgsql-bugs@lists.postgresql.org; Wed, 29 Aug 2018 06:17:43 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1futnF-0005cK-U1 for pgsql-bugs@lists.postgresql.org; Wed, 29 Aug 2018 06:17:41 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 63E87389; Wed, 29 Aug 2018 02:17:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 29 Aug 2018 02:17:26 -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=Bb+XxsWA6z/vp4oEO+xXET+tV8pdib1dt6NRu4puMV4=; b=phl2EfzG voT/d1uivmkSjCeFVin04h51F7GKehi141ABrND+Cyvc41Cmagk31pt8+3xyZ8UL gW/HSjLSST6EZFQL30zE152KUQXVXDIMsOWyjl7jBr65U7m1+i2ra9ah7ljwDb8Q DQD6YyH4db8v0q7OP0OjGgz5o3JkPeK+ZWusxeH53hnZxytcInFfUlCBuUCwDANy UwK/LtK7uCEcbdDWfUDiJOtEtKC/H7YANzmiERJKCxUnsTN9e0v9u2wXVMXw9PH8 WcH4cTNMo1TI0EfSECK836ihy0ekLDfhi6Ld5FYgH2LNST6RG9qW7zjLixYt0ScS uREgrxZruF9/Kw== 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=Bb+XxsWA6z/vp4oEO+xXET+tV8pdi b1dt6NRu4puMV4=; b=fVKudr/yu7zvVnIwqT8nZGF8IzPDXV5gH7dioMkn9OnsF Mu+hhL0+xJGSC3/Juq26e69k+cD/o561bauk1bJbvYJSemI4Xcw9VrqQAjGkbm/M /9IAF/FeOyZgEiiz0GIo8JVKH7jv0zbM1yqbhIRTUk82BO722YQuqFRZ/tGW7WyC qe1oO6Mfu5IeqZaNh3K7a6UOlR2nAkf8+H471Bw3TIoG7U1Dg6d7gOYmUao1YrD7 lq+9YBFNBK0Z2GuXzm5CWhoUuwoP0BDdr9BSLLaWl83TEPqayt71znU0BBLYz5xO bxJ7ySW5zerFp501PaGjDIjfrFUvtmRxqx3sdblJA== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (unknown [66.201.48.83]) by mail.messagingengine.com (Postfix) with ESMTPA id 01904E405E; Wed, 29 Aug 2018 02:17:24 -0400 (EDT) Date: Tue, 28 Aug 2018 23:17:23 -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: <20180829061723.GA5903@paquier.xyz> References: <20180822175034.lnvwk5js32k6mjyz@alvherre.pgsql> <20180823041420.GA1158@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 25, 2018 at 09:54:39AM +0200, Alexander Kukushkin wrote: > Is there a way to recover from such a situation? Should the postgres > in such case do comparison of LSNs and if the LSN on the page is > higher than the current LSN simply return InvalidTransactionId? Hmm. That does not sound right to me. If the page has a header LSN higher than the one replayed, we should not see it as consistency has normally been reached. XLogReadBufferExtended() seems to complain in your case about a page which should not exist per the information of your backtrace. What's the length of relation file at this point? If the relation is considered as having less blocks, shouldn't we just ignore it if we're trying to delete items on it and return InvalidTransactionId? I have to admit that I am not the best specialist with this code. hblkno looks also unsanely high to me if you look at the other blkno references you are mentioning upthread. > Apparently, if there are no connections open postgres simply is not > running this code and it seems ok. Yeah, that's used for standby conflicts. -- Michael --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAluGOnIACgkQnvQgOdby QH1ACg/9GwnkmMunf80J0LhxuYo4i/xtfg408Ep/84ctFggXUGQKqZqAF6mGVy0j S2R06szoOuqLHOKDu6AqNKTPfTLoCw4lqCWt1xtFd4QKF9+wZzBqyAOEVtucqtQz 7+uU3aXHJQoBqz1PxIUBx/XJeAsj+KmtJk4L0NkpZc5tvdLjywY+dRAoi1pnXO7b Wi7MpbX2IuOkhyDCzL+Da93N8xjJsGoIUhqP9SzCFdiLg60XjOsqwZZGmGIYi4ts O7KmKq4bVVeRJ8akXWNeQk8p3HujTZ+EW/B1oO8infYJeJrwCHOz3/GZdiTkYd1a /NhPtBFbdV7mmqCw4eSZByVFEOfNOxceZmyyS2jAJlPj3LUMTVoDo/pBRMAaRuLy P3BBZYf1ydL/n7cKxcUGWh91GdOLFxNmBEp8F8xEAWTFgQBh171CyiVSwT9t7ndw YaiyjNf/lbN1efzGjEqMEGJ/ZXAgI5zEp7UaYugMuvd6Kfue6buzvplGfMC3Tjt6 ogA4Pr1DLqLKDgmf7d3tXRQTfZ4ym5QjvyKLtY97CgMC8kZ9DZ057PNmvBIVBCSw zoL7uyBrVgBfu+ZIsNoXYVrIVzDaB9c8Je97FvxDqGYAwqFkrUBitrWNB7DrN1F5 SfjvzrQV+YzlDs4CF2MqvrbiEru1L7K3SzZr1NbSwpJHUy/dXXg= =RuAG -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+--