pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Craig Ringer <craig.ringer@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: 011_crash_recovery.pl intermittently fails
Date: Thu, 04 Mar 2021 23:40:34 -0500
Message-ID: <1439485.1614919234@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGK50B4soLLa=Vjt58m=GcYtTve7uSGbEEa6dj6GRExAFQ@mail.gmail.com>
References: <20210305.115011.558061052471425531.horikyota.ntt@gmail.com>
	<1436448.1614915141@sss.pgh.pa.us>
	<CAH2-Wz=w2yUTvT75gedn8uL_UX=6fPVAyNMGZ7YMLerSMARo0g@mail.gmail.com>
	<1437508.1614916929@sss.pgh.pa.us>
	<1437804.1614917445@sss.pgh.pa.us>
	<CA+hUKGK50B4soLLa=Vjt58m=GcYtTve7uSGbEEa6dj6GRExAFQ@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> writes:
> On Fri, Mar 5, 2021 at 5:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Alternatively, maybe we can salvage the function's usefulness by making it
>> flush WAL before returning?

> To make pg_xact_status()'s result reliable, don't you need to make
> pg_current_xact_id() flush?  In other words, isn't it at the point
> that you *observe* the transaction that you have to make sure that
> this transaction ID won't be reused after crash recovery.  Before
> that, it's simultaneously allocated and unallocated, like the cat.

We need to be sure that the XID is written out to WAL before we
let the client see it, yeah.  I've not looked to see exactly
where in the code would be the best place.

BTW, I tried simply removing the "allows_streaming" option from
the test, and it failed ten times out of ten tries for me.
So Andres is right that that makes it pretty reproducible in
a stock build.

			regards, tom lane





view thread (32+ messages)  latest in thread

Message-ID: <1439485.1614919234@sss.pgh.pa.us>
Permalink:  ../1439485.1614919234@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1439485.1614919234@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, pg@bowt.ie, horikyota.ntt@gmail.com, pgsql-hackers@lists.postgresql.org, craig.ringer@enterprisedb.com, robertmhaas@gmail.com
  Subject: Re: 011_crash_recovery.pl intermittently fails
  In-Reply-To: <1439485.1614919234@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox