Re: detailed error message of pg_waldump - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: detailed error message of pg_waldump
Date
Msg-id CAD21AoD_mHKsYSVbL3JgCqz3QeAdPKhkybgdvtjj+hpMaHkqHg@mail.gmail.com
Whole thread Raw
In response to detailed error message of pg_waldump  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: detailed error message of pg_waldump  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Fri, Jun 4, 2021 at 5:35 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> In a very common operation of accidentally specifying a recycled
> segment, pg_waldump often returns the following obscure message.
>
> $ pg_waldump 00000001000000000000002D
> pg_waldump: fatal: could not find a valid record after 0/2D000000
>
> The more detailed message is generated internally and we can use it.
> That looks like the following.
>
> $ pg_waldump 00000001000000000000002D
> pg_waldump: fatal: unexpected pageaddr 0/24000000 in log segment 00000001000000000000002D, offset 0
>
> Is it work doing?

Perhaps we need both? The current message describes where the error
happened and the message internally generated describes the details.
It seems to me that both are useful. For example, if we find an error
during XLogReadRecord(), we show both as follows:

   if (errormsg)
       fatal_error("error in WAL record at %X/%X: %s",
                   LSN_FORMAT_ARGS(xlogreader_state->ReadRecPtr),
                   errormsg);

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Error on pgbench logs
Next
From: Dilip Kumar
Date:
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints