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 1nuNI3-0004mM-75 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 May 2022 23:53:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nuNI2-0001c0-2X for pgsql-hackers@arkaria.postgresql.org; Thu, 26 May 2022 23:53:14 +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 1nuNI1-0001Xf-Nh for pgsql-hackers@lists.postgresql.org; Thu, 26 May 2022 23:53:13 +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 1nuNHy-0004Xn-HG for pgsql-hackers@postgresql.org; Thu, 26 May 2022 23:53:13 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7577F5C013A; Thu, 26 May 2022 19:53:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 26 May 2022 19:53:08 -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=fm1; t=1653609188; x=1653695588; bh=Id2vrpqsXQ o3MI6WYWA90+i6/IDpkFySVvbiBJJXVHA=; b=lArH8vBUdHZIYCHUR1PPcX+rla ARTH7+fSQJ5ehQW6dZHimbuy8CCKqJyPdMGkGy/ARtX1b/GslqFrxl+e+/PrkiZb oKLEa6NmE+sWytYhO6/W82uqaegKMcbETwZ0JK6oDPKRzhJ0cCVIWbxX0S3agw7Y IkjQwbl9qKBBMPzxdn8REEYCIVLNu7Yza5PFu8egO4RYN1ZfPjndzpcpkU4J9T6u AMk/bLOsgQusg4goyeDrdr3Hd7XDLDoobUqlrNnEzECQmTH6WnkBZiWOzT1eU90f MXT2LfYLK/HiFWV7PtrxdzZJQj6ocWkgl+3F6GZ6194iaNx/SniNRpVTDq8Q== 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= fm1; t=1653609188; x=1653695588; bh=Id2vrpqsXQo3MI6WYWA90+i6/IDp kFySVvbiBJJXVHA=; b=OhC4YMmTulmOjg0+dPLU33J7EFVSvQwbqTyk7QTFnNmc F6dgKYsF0u2XMo8YPFMejWvAM+VRwT7T7BWJbZzCxST2AaIc24SIH4taaFcSnps9 NJVVJz2sJX77bd5zKeKJ+tNLIpmu6BwcakUQ+t9/iu+Vj6aUEno4XmdbbQYA+cqq hRTM7zIyEX0TrRFXMi2JBpiMf7zP6N0Kf40065Q1JJLDwWKjYM4DM+a3unh5mSk7 RhHD5lrKhqrpesX1r4xML5mGgfI7JgbSlD81efTNCI3xEwItcpUedMupaQ0VfXvp Ytt+OqyC7/s5R3iT09TBvc91pqE8i5JTY6dKHw0IKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeekgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddvtdei jeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 May 2022 19:53:06 -0400 (EDT) Date: Fri, 27 May 2022 08:53:03 +0900 From: Michael Paquier To: "Imseih (AWS), Sami" Cc: "pgsql-hackers@postgresql.org" Subject: Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Message-ID: References: <44D259DE-7542-49C4-8A52-2AB01534DCA9@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mTVEzVthjQ7ArJ86" Content-Disposition: inline In-Reply-To: <44D259DE-7542-49C4-8A52-2AB01534DCA9@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mTVEzVthjQ7ArJ86 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 22, 2022 at 07:20:55PM +0000, Imseih (AWS), Sami wrote: > The overwrite_contrecord was introduced in 13.5 with https://git.postgres= ql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommit;h=3Dff9f111bce24. >=20 > Attached is a patch and a TAP test to handle this condition. The > patch ensures that an overwrite_contrecord is only created if the > missingContrecPtr is ahead of the last wal record. The test you are introducing to force a complete segment to be filled is funky, and kind of nice actually while being cheap. This part particularly makes the test predictable: ++unlink $node->basedir . "/pgdata/pg_wal/$endfile" ++ or die "could not unlink " . $node->basedir =2E "/pgdata/pg_wal/$endfile: $!"; I really like that. > With the patch, running the same tap test succeeds and a PANIC is > not observed. This needs a very close lookup, I'll try to check all that except if somebody beats me to it. -- Michael --mTVEzVthjQ7ArJ86 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKQEt8ACgkQnvQgOdby QH39Uw/9HZyu8cI6BXYHG5i/+int6VbGD6bwB5XoKvW84t4ihnjeLT9PBdNdvSbY eOZ7JkzCz5filFjYq2qnfzKmXuHTXakaCZwxM7YLOhZ7bAixLFne5QTP95MyiCS1 dDP/oDNCKu/3BSThhgFhWDsp041GkalYfNxnJdWbV3RGg6qPzv+MJJvygAxNo3nO hHzoyZZVVXgUGDiOyMKY2UA8iGGpG5ZUB1Gf+LYBIVeBRxozer8GvujoLuJy+Nt6 KeiUv3Er2rQWzSEJw7j9c8UffVGLJPyu30YHV9sAqhxPvyJ9tMtDWzsCnJF/Crfh rcJRxoM4kKYkkEcPoM1IQBgPYrLtQUqGMpqtMEAGC0S0YzOVin0WnF4gH2yeNd2Z 9qCS1vKVXnwqCpuQ5qcWGQxjV/YF3guU7y2heWmfkPM/4Pm6g5R4JiWK8sOx3F4e J96PqMIrHDU2FctwI6iXW93gQiwByXKl6KLQiSN9gsvxOxgHVtb/pu0GEVsiV3aB LP9KY5VKUvmRDAFkxFFbTd8AoW9udL7NIZJ2sU7pmkaw0uP3/FyK80qkfUFS9geW 5cvJzpGgZDoLKciZ28hTl5MKybXGa+TY5iaY2qLcGRRoBWP4kIsvJdjS+0bii0oV qsMG6+XOpnGxMu4n/FwIzG+3c2+7J5kfpDyzK8tAsKe1VuWUjt4= =Jckh -----END PGP SIGNATURE----- --mTVEzVthjQ7ArJ86--