Re: 011_crash_recovery.pl intermittently fails

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Geoghegan <pg@bowt.ie>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Craig Ringer <craig.ringer@enterprisedb.com>, Robert Haas <robertmhaas@gmail.com>
Date: 2021-03-05T04:30:58Z
Lists: pgsql-hackers
On Fri, Mar 5, 2021 at 5:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
> > I'd be kind of inclined to remove this test script altogether, on the
> > grounds that it's wasting cycles on a function that doesn't really
> > do what is claimed (and we should remove the documentation claim, too).
>
> 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.



Commits

  1. Remove recovery test 011_crash_recovery.pl

  2. Add a txid_status function.