Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1unvlM-00Cyub-81 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Aug 2025 09:02:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1unvlL-00F2dC-47 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Aug 2025 09:02:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1unvlK-00F2d2-E5 for pgsql-hackers@lists.postgresql.org; Mon, 18 Aug 2025 09:02:43 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1unvlH-000UEG-2z for pgsql-hackers@lists.postgresql.org; Mon, 18 Aug 2025 09:02:42 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id B1345EC023F; Mon, 18 Aug 2025 05:02:37 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 18 Aug 2025 05:02:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1755507757; x=1755594157; bh=pXWii444vm KEBk9y4LHV57gylZKekKOoHe8+cz58HNQ=; b=VK6A+i/Mx2qs2QbzKknEmQOPKp Tkd343aUYVkLxMIPa1kk6hrPJWezwGigoAQz6W77Ewcs9DhuSZ9v/Vo3OSxdqbhj QNFxN119V6Qx+24ywOxtVK70cNkpA8VyFUrCQFLZtMggSzcD8TPCnNdbsN4QqnAm 1uWVBXS+fzIHk8gUqLdM0k9VuEnOBR07u92foHOGDVrHd4cR/Lg4XnaSQRObPao0 vTvDpXhCZDEkfboZo5BY4Q6Bh9lUdCoUeIkyGOOuhFEGEPsQvac0r6DThC6300rr 3DR9I+ErBQV2SpXhIQLAKD2VvoHMmEyPdSPl6l1aLuuMLAF4XLdBFX8CGooA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1755507757; x=1755594157; bh=pXWii444vmKEBk9y4LHV57gylZKekKOoHe8 +cz58HNQ=; b=iEoXegB5gHuArWHySRcixQUauik7PFZKUFIQE3GBlk0Kw6cQa7N MNjlRxuHARQW3Yi4P1ieP+J9G5gxMltOsOZlWgeSDGntJ6bzVO7Zv4YKc76H+YN8 KS+zIYHgccp3kZorC5OfH7g4mbG7yAl4NutTKlsLvwnWOzqpw9GZS3cg3eC9i/sU CJDi/8WNTGtAraYebklaSHs2Xcnx0PN9lv0PQ4X39GK24bsnQ+4580uQGkpS0apJ hZJ3g68i0hLSGvKZklN4jINW/rOMpgX8YvixKdDwzpEZ+PkTTgYTfnv/LC9jmEYr 9vFgFNFXSIFu2iUa0J6P3rGrs6LmvSYECyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduhedvvddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtdorredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepffduleehgefhkeefgfeftdfhkedu tddvhfdukeeggeehieekffelhfelkeehteefnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepledpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepkhhurh houggrrdhhrgihrghtohesfhhujhhithhsuhdrtghomhdprhgtphhtthhopehpjhesihhl lhhumhhinhgrthgvuggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtohepmhgrrghshh grsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduieesghhm rghilhdrtghomhdprhgtphhtthhopegurghvihgurdhgrdhjohhhnhhsthhonhesghhmrg hilhdrtghomhdprhgtphhtthhopehhohhuiihjrdhfnhhsthesfhhujhhithhsuhdrtgho mhdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepsg gvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Aug 2025 05:02:34 -0400 (EDT) Date: Mon, 18 Aug 2025 18:02:30 +0900 From: Michael Paquier To: "Hayato Kuroda (Fujitsu)" Cc: 'Paul A Jungwirth' , Mutaamba Maasha , Amit Kapila , "David G. Johnston" , "Zhijie Hou (Fujitsu)" , Tom Lane , Bertrand Drouvot , "pgsql-hackers@lists.postgresql.org" Subject: Re: ReplicationSlotRelease() crashes when the instance is in the single user mode Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oWYY+Qm2EADzOrkE" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --oWYY+Qm2EADzOrkE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 18, 2025 at 08:47:27AM +0000, Hayato Kuroda (Fujitsu) wrote: > Here are updated patches. Based on the Robert's suggestion, I separated into two parts. > 0001 fixed the original issue and 0002 prohibited the slot manipulation in > single-user mode. I want to focus on 0001 first because on one would argue it. FWIW, I had my doubts at the beginning on the thread about the use-case, but after re-reading the whole thing I am going to side with Robert's opinion that if a fix to authorize some of the operations is simple, then let's just authorize the case(s) and have the fix. Echoing with Paul, what I find as critically lacking from the proposed patches are regression tests to check and validate the behaviors you are looking for in the patches. Please add some in the shape of perl commands that use direct --single commands of postgres. We have cases that do so currently in the tree: sepgsql and shm. I don't see a reason why we could not do that as well here with run_log(). It is also possible to pass a -c exit_on_error=true to force failures. Not having a test for the single-user case of a slot drop is of course something that we are lacking now. As we are playing with this area of the code, let's add something for this case as well. -- Michael --oWYY+Qm2EADzOrkE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmii7CYACgkQnvQgOdby QH2lDRAAhAFswR9ml64fuWa6vpDMktC6/0rvzASRznUdjblUIZfqysjHZEM75NNZ cT3eGzGH8dJIh+vFLDARVmKAw2MU0/4wGmyYA4UeR9T1Vg6j7iMOlVH9378fvF6S B1SpzZXmJtXtkluRCiaryhNN68jSwezJ0Zj54jqnfDSLNGH2Eev+JqPqW1OpkE5v u4T9S67j4W/T8szLp2F+k8Wj6HiUDi6lbInmCpFPqZkDgJ1PHmECpMRar81iyPWO PwaH730usqjFWmnVWCN1tyF6YpEQfMTzswxlWr6ugVjbEavJ/rEqllwMTvBl/Ttp 1FqG1cZFm+StXAztGHOobqCEwcahyPTttpkNCJyqC0K3fekpNxqNDP3+IyiOyakt XeTEfMJNGvatDW8sKaRMmCYRsGq9af3C7DO5Vqu7qfUYlsTH5qR0blfv+xT/hwFG SMTJT5dBs/DypYrOoBI6eOEqeg36HcgSF8r4AM9MH5dvNl/zUgWedb2SlOSsOc1R rk9o/6UBL1BHQ0Y90YXXqL9PFI2Oq147sVcM5sU0+At6v1jIg9KjAqmQfGBRUq6t 7lk0Qfau1e40VJjOtne44aKAZPp3xqZjxK6dGSQKbfLNCf/p18BwTq3hoI9AfrqX yB2kW0Q0iGhg+9vaeqOBkDu2LaGXelR0Mh/szDxCpKEz7PNBgUI= =jL0m -----END PGP SIGNATURE----- --oWYY+Qm2EADzOrkE--