Re: pg_waldump error message fix

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: bossartn(at)amazon(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_waldump error message fix
Date: 2020-12-11 05:21:57
Message-ID: X9MB9fvSzIyD6K65@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 11, 2020 at 01:30:16PM +0900, Kyotaro Horiguchi wrote:
> currRecPtr is a private member of the struct (see the definition of
> the struct XLogReaderState). We should instead use EndRecPtr outside
> xlog reader.

Please note that this is documented in xlogreader.h. Hmm. I can see
your point here, still I think that what both of you are suggesting
is not completely correct. For example, switching to EndRecPtr would
cause DecodeXLogRecord() to report an error with the end of the
current record but it makes more sense to point to ReadRecPtr in this
case. On the other hand, it would make sense to report the beginning
of the position we are working on when validating the header if an
error happens at this point. So it seems to me that EndRecPtr or
ReadRecPtr are not completely correct, and that we may need an extra
LSN position to tell on which LSN we are working on instead that gets
updated before the validation part, because we update ReadRecPtr and
EndRecPtr only after this initial validation is done.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-12-11 05:42:45 Re: pg_shmem_allocations & documentation
Previous Message Kyotaro Horiguchi 2020-12-11 04:30:16 Re: pg_waldump error message fix