Subject: Re: pgsql: Add contrib/pg_walinspect.

From: Thomas Munro <[email-masked]>
Date: Wed, 27 Apr 2022 14:10:49 +1200

On Wed, Apr 27, 2022 at 1:54 PM Thomas Munro <[email-masked]> wrote:
> On Wed, Apr 27, 2022 at 1:47 PM Tom Lane <[email-masked]> wrote:
> > Thomas Munro <[email-masked]> writes:
> > > Hrmph...  Are you sure you rebuilt the contrib module?   Assuming so,
> > > maybe it's failing in a different way for you and me.  For me, it
> > > always fails after this break is reached in xlogutil.c:
> >
> > >             /* If asked, let's not wait for future WAL. */
> > >             if (!wait_for_wal)
> > >                 break;
> >
> > Hmm.  For me, that statement is not reached at all in successful
> > (make installcheck) runs.  In a failing run, it's reached with
> > wait_for_wal = false, after which we get the "could not read WAL"
> > failure.  Usually that happens twice, as per attached.
>
> Ok, that's the same for me.  Next question: why does the patch I
> posted not help?  For me, the error "could not read WAL at %X/%X",
> seen on the BF log, is raised by ReadNextXLogRecord() in
> pg_walinspect.c.  The patch removes that ereport() entirely (and
> handles NULL in a couple of places).

BTW If you had your local change from debug.patch (upthread), that'd
defeat the patch.  I mean this:

+        if(!*errormsg)
+          *errormsg = "decode_queue_head is null";

---

From: Tom Lane <[email-masked]>
Date: Tue, 26 Apr 2022 22:15:16 -0400

> +          *errormsg = "decode_queue_head is null";

Oh!  Okay, I'll retry without that.

			regards, tom lane