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 1m7rLG-0006fa-WC for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jul 2021 03:31:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m7rLF-0006Xe-Uz for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jul 2021 03:31:45 +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 1m7rLE-0006XW-JA for pgsql-bugs@lists.postgresql.org; Mon, 26 Jul 2021 03:31:45 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7rLB-0004aD-U7 for pgsql-bugs@lists.postgresql.org; Mon, 26 Jul 2021 03:31:43 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D9D37320031A; Sun, 25 Jul 2021 23:31:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 25 Jul 2021 23:31:40 -0400 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=fm2; bh=bt+WyvOnymRrcUrQT5h7a7sjr+v Cj4nLeYN3V6lue1g=; b=B+6TLwyQj0Gsb4tbaS+pd+S09MNPpWTKIws1ysg5hqd OAAkXiAbfeupBNENq+25SWMo/V/QG2gUabcNYjNkgwN7K3ti4Wgan4P8McY6GM2s yiL+ETtvV+4bgxzRv7jxdzyK+aO4H+vY9ptSQQNLoY5D7Jb8H41DsIR9YdRB782V uQqLLuaHknWBmcutINyurX9Y33+nXDuSqEInaeKHWiGR0V3wD3vHI8F0Y02Eyvlq 7OQMbJoKiu9SWpWj9IBHyBNXtUHoZpj/jcNvDmoJcnVf+ZeesGTjiva4or7TlLVQ HDLXJYLYw/Q8ZRe244M1pBmAWQATFhvAoOr1F+OOIqw== 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=fm3; bh=bt+Wyv OnymRrcUrQT5h7a7sjr+vCj4nLeYN3V6lue1g=; b=l/V2XmG70Bikx7ezwTVQiq xMkarSerE1JT1j9vQFIxgbEVFvrYL3Q3jzSb9A25ez951WgjROlvkx/PL+i6vlT9 vIawcYRgfvo1DK01L6uHnLDL0E7HaIgvMLA8YgXn2e9W3kDTvBxLZiEo7+uIAq1i U5FctOCmjTj7vCCSCgvthZDfGeIhlc2XvcMqLN6kNNpjXcxNYixLdamtNc7juwrO r5Ku28ZKioY+MPx0JjouMHNAS9ptqfmBg3uKD1OUV1oeQT2uKUOHzl/rQv0FxlMr mKd7oWwdErlZKZneZSu32xWHPhGs/y5WAEAq8VlaSRhm0jkbbF5DTFzKmEdeXdnw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeeggdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf fukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhi vghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnh epvdegudeuhfdtueeltedtveejheehieevueeigeelteegleejleeiueeiheegvefhnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrg gvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 25 Jul 2021 23:31:37 -0400 (EDT) Date: Mon, 26 Jul 2021 12:31:32 +0900 From: Michael Paquier To: Tom Lane Cc: a.pyhalov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17122: panic on prepare with subsequent pg_advisory_lock() and pg_advisory_xact_lock_shared() Message-ID: References: <17122-04f3c32098a62233@postgresql.org> <924498.1627056766@sss.pgh.pa.us> <1267153.1627163097@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PtpJVnNmPz5KXI2j" Content-Disposition: inline In-Reply-To: <1267153.1627163097@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --PtpJVnNmPz5KXI2j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jul 24, 2021 at 05:44:57PM -0400, Tom Lane wrote: > The reason why not is that the code that's meant to detect that is > just fundamentally inadequate. It's examining individual LOCALLOCK > entries to detect conflicts, but we keep separate LOCALLOCK entries > for different lockmodes on the same object. So pg_advisory_lock() > creates an entry with lockmode ExclusiveLock, while > pg_advisory_xact_lock_shared() creates a different entry with lockmode > AccessShareLock. But they are pointing at the same PROCLOCK, and the > restriction we're dealing with here applies at the PROCLOCK level. For the archives: this has been applied as of 6310809. -- Michael --PtpJVnNmPz5KXI2j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmD+LJQACgkQnvQgOdby QH2whA//dv6xydUMDbyS+ok9rtAadU064UWURGOIrTcvuBBlcL51HQKl1ES4sB8m vVY+eq1HItXFs8LB++F1BzXZBleMsxOmbAkho4r0UrItPNbr7mjjGw1xbbh5vW5o Es+KJAPy6gn/KJIZyxV+ylDdJUkM8szATPnFN2USCEMsbeqn4UX4EMggbOrdUDRL DlOEwFOGZQBPy3Hs3yqcXF6v0rmo3O56CPvPYxIjDCjJmQMyPnQc+3AArlK66yaL QFeaj+x3CfugN83Qi5EfO5UhrrdoPVve2RvZml7q+C1SnjxNyDVdx/OwQKMhOTMj CJsNZ+Aoe0DySB7JzKdPWamyRqjSwpyIFPwu7CVIMgp9y3kiRy5I5VthOmQo8chM LNqRMF7Axs64lXACgoh/D9Go4NYPojlMyAiVRJ/NY69eySePrjIMi8+Iq5VE+fWT FIKybQ6KuQptWkldJfwvm2YDKbEh7WmlVd8PFkupQ27oL7qnLny7sXlj8oFyOhsU g8pkDo1GRYTCzSuH9por3o2eXWJ74z3nDgGgZEDVrIGAguFW+FNjaWeRpbp2+BV9 GPDGRvwTMqtOsV0SKLA6vR/jl4vmPR+c/Z1c6ADqnYq2zLnMYwVMQCPW2Qh8y/Ig eI7jx2vrxlr43tn7OA2H5LwuGL1WKEEQ51yzj735mQsvWohhYu4= =l9nN -----END PGP SIGNATURE----- --PtpJVnNmPz5KXI2j--