Re: Fix of fake unlogged LSN initialization

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix of fake unlogged LSN initialization
Date: 2019-10-24 10:57:33
Message-ID: CANP8+jJtSLud7gfwtPPPCxTwu8BsHg7OUBm6h7wYbZBVmH==xg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 21 Oct 2019 at 06:03, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Sat, Oct 19, 2019 at 05:03:00AM +0000, tsunakawa(dot)takay(at)fujitsu(dot)com
> wrote:
> > The attached trivial patch fixes the initialization of the fake
> > unlogged LSN. Currently, BootstrapXLOG() in initdb sets the initial
> > fake unlogged LSN to FirstNormalUnloggedLSN (=1000), but the
> > recovery and pg_resetwal sets it to 1. The patch modifies the
> > latter two cases to match initdb.
> >
> > I don't know if this do actual harm, because the description of
> > FirstNormalUnloggedLSN doesn't give me any idea.
>
> From xlogdefs.h added by 9155580:
> /*
> * First LSN to use for "fake" LSNs.
> *
> * Values smaller than this can be used for special per-AM purposes.
> */
> #define FirstNormalUnloggedLSN ((XLogRecPtr) 1000)
>
> So it seems to me that you have caught a bug here, and that we had
> better back-patch to v12 so as recovery and pg_resetwal don't mess up
> with AMs using lower values than that.
>

I wonder why is that value 1000, rather than an aligned value or a whole
WAL page?

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Solutions for the Enterprise

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-10-24 11:03:31 Re: [HACKERS] Block level parallel vacuum
Previous Message Amit Kapila 2019-10-24 10:51:37 Re: [HACKERS] Block level parallel vacuum