Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5hpP-0007Bj-3z for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 06:02:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o5hpM-0000rj-VN for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 06:02:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5hpL-0000me-KF for pgsql-hackers@lists.postgresql.org; Mon, 27 Jun 2022 06:02:28 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5hpD-0004Wv-JX for pgsql-hackers@postgresql.org; Mon, 27 Jun 2022 06:02:27 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 557D75C0114; Mon, 27 Jun 2022 02:02:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 27 Jun 2022 02:02:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1656309736; x=1656396136; bh=9rfLttY3SR sXKBLzNl7zs9rPkVf69YhcYjCgkj8i51U=; b=LS/p4sRnZfh3XEMAdWU0ZioqmE RWAFS49FI3SYv8stvBlRyB33PBQT4Dqh9+MyVuBp5jbrFudNFg55ee5RIfA8Jg2l Ha8IeTS4/JWala+WKGl21zbr782vlYVIw031VSWdX+WPEDvfuObHiXdMavZ7l1Cy ILH/VDJSc7XezuH/AKVsETFfpkaRVFu709xMin/mAo5UucWV7n5T5i3RBPqydws7 xCdaXg8bOxQMcDY5VkKycy9fxuJWvXBPSIp/sinUzXu2piYwKovwXrCEHNcf+tB+ 8uSNW24exiSWXYIsCHU4PmcsUflxoulVGP0KvM2kdYSxIJNyFUFwrFAxjXDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1656309736; x=1656396136; bh=9rfLttY3SRsXKBLzNl7zs9rPkVf6 9YhcYjCgkj8i51U=; b=J/YK37czY+dsphhqKLD1qihRhPGTYJZoAu0paoqzZT4s yAj7Y8p1257upqdpM7N1O3XMVOUmsdeNF5aGxpkrMEDDHvYR3DyrMjOHt/+qgueM CzEMzWQkLSqgt022xJlwsKUNImXSMUVgmUwaMPPbUzgpX5++TTJQe0Kss38UykcW JMLABB/yFLI1ASCJuAoOEKjcyk+rLUPuaj+HxhyHdT9LCL4tTLVXumo6Ho6X7OcF XKkCjFvF7ByoCiq8Ehrhqr6053PaeWXMKvLZ+2UyBxLYmnvGFE1rZzS9hhSbB6D4 7+fsnazPUY7gaSOuprRHJy90od2M4nZesLmF4TRK2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeggedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jun 2022 02:02:14 -0400 (EDT) Date: Mon, 27 Jun 2022 15:02:11 +0900 From: Michael Paquier To: "Imseih (AWS), Sami" Cc: Kyotaro Horiguchi , "alvherre@alvh.no-ip.org" , "pgsql-hackers@postgresql.org" Subject: Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Message-ID: References: <20220527.153735.871115454014517938.horikyota.ntt@gmail.com> <20220620.202830.1255811739875634656.horikyota.ntt@gmail.com> <7AF889CF-315C-4FB7-88C0-734FE3F01DE9@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QnfQqflUtYpwIWrd" Content-Disposition: inline In-Reply-To: <7AF889CF-315C-4FB7-88C0-734FE3F01DE9@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QnfQqflUtYpwIWrd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 24, 2022 at 04:17:34PM +0000, Imseih (AWS), Sami wrote: > It is been difficult to get a generic repro, but the way we reproduce > Is through our test suite. To give more details, we are running tests > In which we constantly failover and promote standbys. The issue > surfaces after we have gone through a few promotions which occur > every few hours or so ( not really important but to give context ). Hmm. Could you describe exactly the failover scenario you are using? Is the test using a set of cascading standbys linked to the promoted one? Are the standbys recycled from the promoted nodes with pg_rewind or created from scratch with a new base backup taken from the freshly-promoted primary? I have been looking more at this thread through the day but I don't see a remaining issue. It could be perfectly possible that we are missing a piece related to the handling of those new overwrite contrecords in some cases, like in a rewind. > I am adding some additional debugging to see if I can draw a better > picture of what is happening. Will also give aborted_contrec_reset_3.patc= h=20 > a go, although I suspect it will not handle the specific case we are deai= ng with. Yeah, this is not going to change much things if you are still seeing an issue. This patch does not change the logic, aka it just simplifies the tracking of the continuation record data, resetting it when a complete record has been read. Saying that, getting rid of the dependency on StandbyMode because we cannot promote in the middle of a record is nice (my memories around that were a bit blurry but even recovery_target_lsn would not recover in the middle of an continuation record), and this is not bug so there is limited reason to backpatch this part of the change. -- Michael --QnfQqflUtYpwIWrd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmK5R+MACgkQnvQgOdby QH1GdA/7BWw/migsHZ32opyR5tklAt84s/6PiysDCFc9LjtZPDoGjNwzLsl3XPm6 LjKh2/HxIE2IXv7i24VJEe9IE7/Z5kuT6kyottFCpxoWX2chnlP6miVKCZLFgFjt cxUbFRnBgwLLcmibLkjBiDAExaL3el0PBcjxzZcww/MZ/KU0oLmkrvvAw6qJwca0 SX7oMymOX2Z0g4DRckQJ5WeSBKfC3qJyVAVVrKTCqbxOLk4wuIRb6UyzAnkYiQXe xmBBtIWalGhTlwCHDRyIYfOysZ3MjCJUg0nmL6czOoGvdycVFX8wHZlVME6tJo43 q4+hR8YOsStlOKtEOUtf/0s4sYlZMXHyC7uLAhaa1D/5l55jnVRe79KFPA1nRPKA RE56/OQzAhRm2H9xa80y8IkEnWsl8rpoVGL8zqjzLeJwQWNiIlmpk+2HJZgHkY/C C3aWj70HfTAyU76bxoWqLHcnRweaNrOkSpL+BQr/lsBbbftzWkCzGMZpQN1QpGtJ rWMHLAhOrSodXIIGXLwDwzCD/9F2GxEs9O3jwaLIWqvJygvU4C/OXayobkTCV8CC 8KNDwSB/vfvvPnZ7jXtOUbzgjUPjwqeF7e5Wj+wNppd9CFNsRswPpkXjpv4WUk3h CFEzDIuLP6gHswPsSRcwGBSZRFkD7+MOvBFcfNFXhcNafqgeWW4= =/9vU -----END PGP SIGNATURE----- --QnfQqflUtYpwIWrd--