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 1sdw70-002P2K-6z for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Aug 2024 18:19:14 +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 1sdw6y-005Vew-PF for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Aug 2024 18:19:12 +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 1sdw6x-005Veo-7D for pgsql-bugs@lists.postgresql.org; Tue, 13 Aug 2024 18:19:12 +0000 Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdw6q-004gyy-2P for pgsql-bugs@lists.postgresql.org; Tue, 13 Aug 2024 18:19:10 +0000 Received: from phl-compute-08.internal (phl-compute-08.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id E2045115123D; Tue, 13 Aug 2024 14:19:01 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Tue, 13 Aug 2024 14:19:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723573141; x= 1723659541; bh=Yd7qHUblMvPJDNSENwSqEfQrirBLwAGB55yVvpSX6kI=; b=g V8/Q+uNPWzhKvmqiR47+0k4HakBZZUdya/9+u7XNsC8gKxmEwQt16CA27kAUIMwG 8sJ+rVCoF0zfHk1PKvbGJP/earHFHUnIxqCRSP7iqaNbCRykML45HVSvlkGKVEq3 alH289r26xzQdBCz9cv+1RAtiPYi2N7GET/nl0e0qQ3PljDf8e34WGHOWyPw/tS/ IZkmwBXh4dsd0auBnyyG3IFrjSahXUEvFIX9+3C3kS2kMb5CkjR5edlQLL05Bx+Q X53BnB2Y8X1n3KHizy3sbZgmwb3vhr5alUX7wZsJAkWs8nouHEIFeGqVzv6sTIEu FU1ZX7z8C2+WLoQaPB8ww== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtvddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehmkeerredttdej necuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcufhhrohhmucdvnhgusfhurggurh grnhhtuceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgr thhtvghrnhepudekteeugfetgeffjeefveekgfekjeffffejjeelvedugfffgfevgfdtff ekffdtnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrg hlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopehkuhhnthgrlhhghhhoshhhrddvtddtjeesghhmrghilhdrtg homhdprhgtphhtthhopehtnhgurhifrghnghesghhmrghilhdrtghomhdprhgtphhtthho peiihhhjfihpkhhusehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqsghugh hssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Aug 2024 14:19:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1723573138; bh=7GRpaSB3hAmMJvYRO0ecAMzH+10Eegl/9Cnz+eX21mg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=aWNpDUQTyMaiOyE2NNxWYV656XAMf0EIFpN/+WrLQtrwmxL7E82VRpkJ5xRmE5Vhb 5NWJN/L1eT3dcxj5P5HPDnG6zI+GftoIJdnuZmIwwXExdq/VptC6Y/UnmOarFz7IIF jwfLdURzpWlfwC7dUI8rRGcV6wRnJHizu3Zd+IQCyJ/efWgUx8+srhGjvkIC9Q2Vy+ daTjac6F0UaQHWH9j6tE14yirTlH1PxkaK5krOdUi20pSXBRKTBmqWbTw1xPMMXb2u 6U0HuWgxlBhBI6Xv4kF919UjUApGDT6yQstPhjvoJpkLbIWwtZCrq5VOTIEmnQBO7T wa1+SeP/0N9CQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 5A1E133E; Tue, 13 Aug 2024 14:18:58 -0400 (-04) Date: Tue, 13 Aug 2024 14:18:58 -0400 From: Alvaro Herrera from 2ndQuadrant To: Kuntal Ghosh Cc: Junwang Zhao , Tender Wang , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18559: Crash after detaching a partition concurrently from another session Message-ID: <202408131818.bltdxziu2jpj@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gxl4twfi4xob65vc" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --gxl4twfi4xob65vc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2024-Aug-13, Kuntal Ghosh wrote: > That means - after getting the live partitions from > prune_append_rel_partitions(), by the time the code tries to lock a > child, it's already dropped. Right. > However, similar check is not there in expand_partitioned_rtentry(). > Introducing the same check will fix the issue. But, I don't know how > it affects the pruning part as this partition couldn't be pruned > earlier and that's why we're opening the child partition. Hmm, we could just remove the partition from the set of live partitions -- then it should behave the same as if the partition had been pruned. Something like the attached, perhaps. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "In fact, the basic problem with Perl 5's subroutines is that they're not crufty enough, so the cruft leaks out into user-defined code instead, by the Conservation of Cruft Principle." (Larry Wall, Apocalypse 6) --gxl4twfi4xob65vc Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Don-t-open-partitions-that-were-detached-and-dropped.patch"