Re: Fix for visibility check on 14.5 fails on tpcc with high concurrency

From: Dimos Stamatakis <dimos(dot)stamatakis(at)servicenow(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, "simon(dot)riggs(at)enterprisedb(dot)com" <simon(dot)riggs(at)enterprisedb(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix for visibility check on 14.5 fails on tpcc with high concurrency
Date: 2022-11-25 15:46:08
Message-ID: CO2PR0801MB23105C3ADC7DCE8FFFD7D314E20E9@CO2PR0801MB2310.namprd08.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So does this mean there is no race condition in this case and that this error is redundant?

Thanks,
Dimos
[ServiceNow]

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Date: Thursday, 24. November 2022 at 19:24
To: Dimos Stamatakis <dimos(dot)stamatakis(at)servicenow(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, simon(dot)riggs(at)enterprisedb(dot)com <simon(dot)riggs(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix for visibility check on 14.5 fails on tpcc with high concurrency
[External Email]

On 2022-Nov-24, Alvaro Herrera wrote:

> On 2022-Nov-24, Dimos Stamatakis wrote:
>
> > rmgr: MultiXact len (rec/tot): 54/ 54, tx: 248477, lsn: 0/66DB82A8, prev 0/66DB8260, desc: CREATE_ID 133 offset 265 nmembers 2: 248477 (nokeyupd) 248500 (keysh)
> > rmgr: Heap len (rec/tot): 70/ 70, tx: 248477, lsn: 0/66DB82E0, prev 0/66DB82A8, desc: HOT_UPDATE off 20 xmax 133 flags 0x20 IS_MULTI EXCL_LOCK ; new off 59 xmax 132, blkref #0: rel 1663/16384/16385 blk 422
> > rmgr: Transaction len (rec/tot): 34/ 34, tx: 248477, lsn: 0/66DBA710, prev 0/66DBA6D0, desc: ABORT 2022-11-23 20:33:03.712298 UTC
> > …
> > rmgr: Transaction len (rec/tot): 34/ 34, tx: 248645, lsn: 0/66DBB060, prev 0/66DBB020, desc: ABORT 2022-11-23 20:33:03.712388 UTC
>
> Ah, it seems clear enough: the transaction that aborted after having
> updated the tuple, is still considered live when doing the second
> update. That sounds wrong.

Hmm, if a transaction is aborted but its Xid is after latestCompletedXid,
it would be reported as still running. AFAICS that is only modified
with ProcArrayLock held in exclusive mode, and only read with it held in
share mode, so this should be safe.

I can see nothing else ATM.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/<https://www.EnterpriseDB.com>
"I must say, I am absolutely impressed with what pgsql's implementation of
VALUES allows me to do. It's kind of ridiculous how much "work" goes away in
my code. Too bad I can't do this at work (Oracle 8/9)." (Tom Allison)
http://archives.postgresql.org/pgsql-general/2007-06/msg00016.php<http://archives.postgresql.org/pgsql-general/2007-06/msg00016.php>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ted Yu 2022-11-25 15:56:13 checking rd_rules in RelationBuildDesc
Previous Message Israel Barth Rubio 2022-11-25 15:17:02 Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands