Re: Race condition in TransactionIdIsInProgress - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Race condition in TransactionIdIsInProgress
Date
Msg-id 20220212004124.ikuh7zxpcauk6olz@alap3.anarazel.de
Whole thread Raw
In response to Re: Race condition in TransactionIdIsInProgress  (Andres Freund <andres@anarazel.de>)
Responses Re: Race condition in TransactionIdIsInProgress
List pgsql-hackers
Hi,

On 2022-02-10 22:11:38 -0800, Andres Freund wrote:
> Looks lik syncrep will make this a lot worse, because it can drastically
> increase the window between the TransactionIdCommitTree() and
> ProcArrayEndTransaction() due to the SyncRepWaitForLSN() inbetween.  But at
> least it might make it easier to write tests exercising this scenario...

FWIW, I've indeed reproduced this fairly easily with such a setup. A pgbench
r/w workload that's been modified to start 70 savepoints at the start shows

pgbench: error: client 22 script 0 aborted in command 12 query 0: ERROR:  t_xmin 3853739 is uncommitted in tuple
(2,159)to be updated in table "pgbench_branches"
 
pgbench: error: client 13 script 0 aborted in command 12 query 0: ERROR:  t_xmin 3954305 is uncommitted in tuple (2,58)
tobe updated in table "pgbench_branches"
 
pgbench: error: client 7 script 0 aborted in command 12 query 0: ERROR:  t_xmin 4017908 is uncommitted in tuple (3,44)
tobe updated in table "pgbench_branches"
 

after a few minutes of running with a local, not slowed down, syncrep. Without
any other artifical slowdowns or such.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc