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 1s6Yxo-000LQY-EI for pgsql-bugs@arkaria.postgresql.org; Mon, 13 May 2024 16:55:49 +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 1s6Yxo-002Vce-CO for pgsql-bugs@arkaria.postgresql.org; Mon, 13 May 2024 16:55:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6Yxo-002VcB-19 for pgsql-bugs@lists.postgresql.org; Mon, 13 May 2024 16:55:48 +0000 Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6Yxh-0001mj-UV for pgsql-bugs@lists.postgresql.org; Mon, 13 May 2024 16:55:46 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id B01C81C00152; Mon, 13 May 2024 12:55:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 13 May 2024 12:55:39 -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=1715619339; x= 1715705739; bh=QiVmTKvaz8pkllLTLV4fstsZZgz8A0dG7Wu0Vvy44MQ=; b=H O5IG0SrSJboNeuwCO9Mw/u1/nxb4U+G3vkIcAB5lYJ4FPzZrVcEcFtxbKN1Cmh8q qc0sM3WdhnMymCHJdPSRTsCrfz7gZiRFccLR1JZyrdqNUzahtl9pXQUSylMIEekc TV1XNeHPrigV1B7duIisx0w1dtRs2s32EoBIHK7hiS8NWgD+aLeaPCAA3MvzOzOH Fy0R9gt/fE4BlRw+071qoeyqdLXW1MrIh9f9zRzn7kOzneX0XIyOsDuFHWz+wge9 HgKKzGbk8Ri6znfmMVPUd11joHSsYK57En4tI78Fq5CNt660lwJrPai5ydBi5ERe txITkQXVUz2w+YhCkK20w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeggedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 May 2024 12:55:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1715619336; bh=nWvb/8cOyLLq9lOBPOa9Hvx5FFNggbgsAjmLqNhnbUw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=A38+DhC1saOMsSVuGG9BbVxnIWMaCmu79cP0xrVddBuAMWiFdaJuHt0kuo3pxindV XUatgcI+8Hy2zCCfpPOHAikKX5gDEXDNEFtdvdNknSFGAopOebm0r4f2HkeqKlTSZT q1E8jFY3zSXqRL8RJHrMl5Yphp1MhdAUY6uDcl/SmmvO04FO2zjxyDaDjRDFRpca4H ZSRQsaU6BWGF1FzmRKL0uWk4gLmxuIMk9TrVCCGPsV3VOScJPzxsEfVPLnpCtUk+w1 rcz90QVQ2ccmFVaZwHNcxLjaxTrYgVXeGC2VK40TjK19r4KLHKfKIZuJXa0dIyNYQ6 1uqbIy0OgR6cQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id B333AA4; Mon, 13 May 2024 18:55:36 +0200 (CEST) Date: Mon, 13 May 2024 18:55:36 +0200 From: Alvaro Herrera To: Tender Wang Cc: 1026592243@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18377: Assert false in "partdesc->nparts >= pinfo->nparts", fileName="execPartition.c", lineNumber=1943 Message-ID: <202405131655.zqmzo7idv7ho@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 On 2024-Apr-18, Tender Wang wrote: > Now we switch to gdb2, breakpoint at RelationCacheInvalidateEntry(). We > continue gdb2, and we will > stop at RelationCacheInvalidateEntry(). And we will see that p relation > cache item will be cleared. > The backtrace will be attached at the end of the this email. Here is where I think the problem occurs -- I mean, surely PlanCacheRelCallback marking the plan as ->is_valid=false should cause the prepared query to be replanned, and at that point the replan would see that the partition is no more. So by the time we get to this: > Entering ExecInitAppend(), because part_prune_info is not null, so we will > enter CreatePartitionPruneState(). > We enter find_inheritance_children_extended() again to get partdesc, but in > gdb1 we have done DetachPartitionFinalize() > and the detach has commited. So we only get one tuple and parts is 1. we have made a new plan, one whose planner partition descriptor has only one partition, so it'd match what ExecInitAppend sees. Evidently there's something I'm missing in how this plancache invalidation works. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/