Re: Race condition in TransactionIdIsInProgress

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Race condition in TransactionIdIsInProgress
Date: 2022-02-11 13:48:59
Message-ID: CANbhV-GA0zLg_tFz=tjwSGxNXz9FVV9704vKmt+odbBQiwFCVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 11 Feb 2022 at 08:48, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com> wrote:
>
> On Fri, 11 Feb 2022 at 06:11, Andres Freund <andres(at)anarazel(dot)de> 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...
>
> Agreed
>
> TransactionIdIsKnownCompleted(xid) is only broken because the single
> item cache is set too early in some cases. The single item cache is
> important for performance, so we just need to be more careful about
> setting the cache.

Something like this... fix_cachedFetchXid.v1.patch prevents the cache
being set, but this fails! Not worked out why, yet.

just_remove_TransactionIdIsKnownCompleted_call.v1.patch
just removes the known offending call, passes make check, but IMHO
leaves the same error just as likely by other callers.

--
Simon Riggs http://www.EnterpriseDB.com/

Attachment Content-Type Size
fix_cachedFetchXid.v1.patch application/octet-stream 2.8 KB
just_remove_TransactionIdIsKnownCompleted_call.v1.patch application/octet-stream 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-02-11 13:54:36 pgsql: Add suport for server-side LZ4 base backup compression.
Previous Message Ashutosh Sharma 2022-02-11 13:43:58 Re: Identify missing publications from publisher while create/alter subscription.