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 1mun0m-0005ZG-SR for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Dec 2021 02:48:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mun0k-0003cA-Dq for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Dec 2021 02:48:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mun0j-0003bt-A0 for pgsql-bugs@lists.postgresql.org; Wed, 08 Dec 2021 02:48:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mun0g-00089a-DN for pgsql-bugs@lists.postgresql.org; Wed, 08 Dec 2021 02:48:48 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2B23F3201C29; Tue, 7 Dec 2021 21:48:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 07 Dec 2021 21:48:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=EypunEfk7cf1uYoDfrIf4b1Z+QS 6TAu9RB8Vs7K8WfI=; b=aKxtIb4XzMgLX18vHPCeJXlGQKKlg7EfU6hJbME0r6G lei9dy3vR/EATZwhGeNKL9menyu6ymwj+12/blndfOaffZZe/xHW7VS1cQsPHJF0 gSa+Ftper59EfZnCPx4UD6DGo8EiDExbARiy4NpnHMikaFq1uusQoGnnVcLmtAnZ iP7I7bsbRPgGs0qpnaZ1GVXHkvDHW3tY46WwnSAhWA8M5st/4fgrA9OqhZgtX/A8 CLG9LiPzmFZ00/X+KW9pa+3q+EsmZlBjamfltwzvJrk95NzJdihKmz+CCV+4s9Js q7tnLyHbh8MXAHjXwBgrC/UGvLPZFTc2oIkv1fO9m3A== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=EypunE fk7cf1uYoDfrIf4b1Z+QS6TAu9RB8Vs7K8WfI=; b=eLdjf0X8mdJ80WPqga+NkD ++QrsRXoKTHrOBtE2/YxFF6gOLPUFB672VcwHBSOoVGAcK3FCBcRcKwj2TVxX+PO yE+UBmGEchubiApCsXtWst5ED4HwmIFgVqdnCjjjI/9a9kWoGaFGLGks9aSUimzf 1GhLgffEWS5GfA70ddhIQ/Jqvu3SzI0ngbonX8WE3EKod0RmfQ3IB9AaFbHXP6J9 mzBVc9ZNWo9oniO3k4D37izQ2MMoy0k81ZOHXfhabSUL8q/V0+JF8dQJ1QwFlYS/ lpp5eyrH2OTalo1rNN1HqXj9qVin11dnp928U+dwXlP1wLJ5Wg1S1033GQo+ZahA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeejgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Dec 2021 21:48:40 -0500 (EST) Date: Wed, 8 Dec 2021 11:48:37 +0900 From: Michael Paquier To: "Bossart, Nathan" Cc: Noah Misch , Andres Freund , Alexey Ermakov , Robert Haas , Maxim Boguk , PostgreSQL mailing lists , Peter Geoghegan Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently Message-ID: References: <20211109050848.oe3u6mhtomkaoxrx@alap3.anarazel.de> <20211109054625.GB940092@rfd.leadboat.com> <20211109063119.ukcvdk7uvz7ks3pa@alap3.anarazel.de> <20211109064217.GC940092@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UKUagYmf/LARoVv9" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --UKUagYmf/LARoVv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 07, 2021 at 10:04:54PM +0000, Bossart, Nathan wrote: > I confirmed that the new tests reliably produce corruption and that > the suggested fix resolves it. I also lean towards the simple > solution, but I do wonder if it creates any interesting side effects. Thanks. > For example, could holding the locks longer impact performance? Do you have anything particular in mind? It seems to me that this boils down to the same lock taken on the parent table based on its RTE. > - toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock); > - table_close(toastrel, RowExclusiveLock); > + toast_close_indexes(toastidxs, num_indexes, NoLock); > + table_close(toastrel, NoLock); >=20 > I think it would be good to expand the comments above these changes to > explain why we are keeping the lock. That might help avoid similar > problems in the future. Yes, I have added a note, and applied the patch after looking at it again this morning. The test cannot be used in 12 so I have removed it from REL_12_STABLE, as allow_system_table_mods is a PGC_POSTMASTER there. -- Michael --UKUagYmf/LARoVv9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmGwHQUACgkQnvQgOdby QH35kg//cmyFCeLmBkIrtE13cJ8JuGCO5LrtztQEUGKRuQA8z1JHKb1uhXourSZg +z5NbeJ2nfBevq+C+qZWlLPOmyxyIKLdQGEqZ3VVUWvUpDdL23W4z2Rgjla461EX Sz8b54kvErZIdREo07jDF6NOlBiXiJ6Bf7RjYshlHEBXd4Sy3mYMsEOgC4bMBvwh aVGPxQKscRCRezgs3Avu71559UZEAcUKamnwkmX477VksRZ/py+SGp5rs1iD3E3q OVExyIbPfcvQIzXGNyhvlzGDMf8ikyGN02HPIyOlFxNU6IDGpeTXltc6mkoPMqnk lrziTda/W2qWPf/enIemYTbYU5Hry+l0czHRndfRVNcTkoN6JK/NfxLhOmpTnqtc z44DY3/TE+zuybHCwAjyuoZD5uDGQOB51zEUY6HzYSa5X+LQw50XK7zzGN+MFA4e r5GS478LZuj4yHEUkEbKOPX5eO2hJxVg+k+lA22WRjTsY6M8fK8dQ4ZFwJ5ywOUX 39+ag7CRgHmzSxuYtF/MFPNQsyvUCAVziUKC1a3cG1eZN4Ja2VXcEevPqVFv338T 9pJlSZHreNPMCdPcKkffbOuhTmQmRguRsyUP9OX9cp7eqP2NxRUQDi1jlLFb75hH siQ1ptr/RQNud7pa4ojoArGOt+c53Z3TOWk6mbrWBd/eFwANqq0= =3Ua9 -----END PGP SIGNATURE----- --UKUagYmf/LARoVv9--