Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu1B3-0007JW-RL for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Mar 2018 19:26:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eu1B2-0006Mi-5U for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Mar 2018 19:26:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu1B1-0006MY-UM; Thu, 08 Mar 2018 19:26:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu1Ay-0006mH-T7; Thu, 08 Mar 2018 19:26:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w28JPxei023435; Thu, 8 Mar 2018 14:25:59 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org, Robert Haas , Pavan Deolasee , amul sul , Amit Kapila , Stephen Frost , PostgreSQL-development Subject: Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key In-reply-to: References: <20180111143641.GJ2416@tamriel.snowman.net> <10896.1520521635@sss.pgh.pa.us> <8293.1520528639@sss.pgh.pa.us> <21103.1520534813@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Thu, 08 Mar 2018 11:19:12 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23433.1520537159.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 08 Mar 2018 14:25:59 -0500 Message-ID: <23434.1520537159@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On March 8, 2018 10:46:53 AM PST, Tom Lane wrote: >> Breaking fundamental invariants like >> "ctid points to this tuple or its update successor" is going to cause >> trouble. There's a lot of code that knows that; more than knows the >> details of what's in xmax, I believe. > I don't think this is that big a problem. All code already needs to hand= le the case where ctid points to an aborted update tuple. Which might long= have been replaced by as an independent role. That's why we have all this= updated.xmax =3D=3D new.xmin checks. Which will, without any changes, cat= ch the proposed scheme, no? No. In those situations, the conclusion is that the current tuple is live, which is exactly the wrong conclusion for a cross-partition update. Or at least it might be the wrong conclusion ... I wonder how this patch works if the updating transaction aborted. regards, tom lane