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 1n9Sy2-0005J0-00 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jan 2022 14:26:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9SxV-0005yT-62 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jan 2022 14:26:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9SxU-0005yK-70 for pgsql-hackers@lists.postgresql.org; Mon, 17 Jan 2022 14:26:08 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9SxO-0003gg-5p for pgsql-hackers@postgresql.org; Mon, 17 Jan 2022 14:26:07 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3462432004ED; Mon, 17 Jan 2022 09:25:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 17 Jan 2022 09:25:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=DAsyCh5OgP7UuksLMYuZBaDGLLhLuZYSWf5WjzWBUGU=; b=Pb5lN9hK u13dCZuP0Ff9NXAceOzM9z8xnH8R3b/YU6zeOmfZUvoWE/ddMnEOPX5ne9Ijci0e lugg4kHZhjcZvXXgFRzGWFa/jLvrKFnH4XcyIa8RAT1PYwoPRxGnQ4i5YZbo42R6 lwfc8yPM2XKLDMdj48knnjQP6frY2BIXG/csGeYE7qExAAquZEswhQDWgW1pkIIZ HI0OosAmnqAv+/kRcPNprWM80mgEf1QpfSFUkFhjFjH+u0+6oCDGqmSaBZj87Ver 32BFazbp8JaU4GIHvPpKsfMlzU53GK0auyMGA303SptaTJeiTv8VlJjJVYCmIF0i cilHQKTN/Jli1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddugdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Jan 2022 09:25:56 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0DF392A07D3; Mon, 17 Jan 2022 11:25:53 -0300 (-03) Date: Mon, 17 Jan 2022 11:25:53 -0300 From: Alvaro Herrera To: Amit Langote Cc: Andrew Dunstan , Ibrar Ahmed , Arne Roland , "David G. Johnston" , Masahiko Sawada , Peter Eisentraut , PostgreSQL-development , Rahila Syed , Tomas Vondra Subject: Re: a misbehavior of partition row movement (?) Message-ID: <202201171425.wmli5geb4qi3@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 2022-Jan-17, Amit Langote wrote: > Note that the fix involves adding fields to ResultRelInfo -- v13 needs > 2 additional, while v14 and HEAD need 1. That combined with needing > new catalog entries for parent FK triggers, back-patching this does > make me a bit uncomfortable. Yeah, that's a good point, so I ran abidiff on the binaries in branch 13 to have some data on it. The report does indeed have a lot of noise about those three added members in struct ResultRelInfo; but as far as I can see in the report, there is no ABI affected because of these changes. However, the ones that caught my eye next were the ABI changes for ExecGetTriggerResultRel() and ExecAR{Delete,Update}Triggers(). These seem more significant, if any external code is calling these. Now, while I think we could dodge that (at least part of it) by having a shim for AfterTriggerSaveEvent that passes a NULL mtstate, and takes the assumption that there is no row partition migration when that happens ... that seems like treading in dangerous territory: we would have code that would behave differently for an extension that was compiled with an earlier copy of the backend. So I see two options. One is to introduce the aforementioned shim, but instead of making any assumptions, we cause the shim raise an error: "your extension is outdated, please recompile with the new postgres version". However, that seems even more harmful, because production systems that auto-update to the next Postgres version would start to fail. The other is suggested by you: > Another thing to consider is that we haven't seen many reports of the > problem (UPDATEs of partitioned PK tables causing DELETEs in > referencing tables), even though it can be possibly very surprising to > those who do run into it. Do nothing in the old branches. Another thing I saw which surprised me very much is this bit, which I think must be a bug in abidiff: type of 'EPQState* EState::es_epq_active' changed: in pointed to type 'struct EPQState' at execnodes.h:1104:1: type size hasn't changed 1 data member changes (3 filtered): type of 'PlanState* EPQState::recheckplanstate' changed: in pointed to type 'struct PlanState' at execnodes.h:1056:1: entity changed from 'struct PlanState' to compatible type 'typedef PlanState' at execnodes.h:1056:1 -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "La grandeza es una experiencia transitoria. Nunca es consistente. Depende en gran parte de la imaginación humana creadora de mitos" (Irulan)