Re: 039_end_of_wal: error in "xl_tot_len zero" test

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Anton Voloshin <a.voloshin@postgrespro.ru>, Tom Lane <tgl@sss.pgh.pa.us>, David Rowley <dgrowleyml@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2024-08-29T05:41:36Z
Lists: pgsql-hackers

Attachments

On Sat, Aug 24, 2024 at 10:43 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Sat, Aug 24, 2024 at 10:33 AM Nathan Bossart
> <nathandbossart@gmail.com> wrote:
> > I am seeing the exact problem described in this thread on my laptop since
> > commit 490f869.  I have yet to do a thorough investigation, but what I've
> > seen thus far does seem to fit the subtle-differences-in-generated-WAL
> > theory.  If no one is planning to pick up the fix soon, I will try to.
>
> Sorry for dropping that.  It looks like we know approximately how to
> stabilise it, and I'll look at it early next week if you don't beat me
> to it, but please feel free if you would like to.

It fails reliably if you nail down the initial conditions like this:

 $TLI = $node->safe_psql('postgres',
        "SELECT timeline_id FROM pg_control_checkpoint();");

+$node->safe_psql('postgres', "SELECT pg_switch_wal();");
+emit_message($node, 7956);
+
 my $end_lsn;
 my $prev_lsn;

The fix I propose to commit shortly is just the first of those new
lines, to homogenise the initial state.  See attached.  The previous
idea works too, I think, but this bigger hammer is more obviously
removing variation.

Commits

  1. Stabilize 039_end_of_wal test.

  2. Create syscache entries for pg_extension