Re: detailed error message of pg_waldump

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: detailed error message of pg_waldump
Date: 2021-06-16 07:52:11
Message-ID: CAD21AoD_mHKsYSVbL3JgCqz3QeAdPKhkybgdvtjj+hpMaHkqHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 4, 2021 at 5:35 PM Kyotaro Horiguchi
<horikyota(dot)ntt(at)gmail(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-06-16 07:52:12 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Previous Message Michael Paquier 2021-06-16 07:49:43 Re: Error on pgbench logs