Re: pg_rewind: warn when checkpoint hasn't happened after promotion - Mailing list pgsql-hackers

From James Coleman
Subject Re: pg_rewind: warn when checkpoint hasn't happened after promotion
Date
Msg-id CAAaqYe9L_c1Z6qsXGXSQ7_d=U3HA1N0uJGLz_MW40zZwvB-FtA@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind: warn when checkpoint hasn't happened after promotion  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_rewind: warn when checkpoint hasn't happened after promotion
List pgsql-hackers
On Tue, Jul 5, 2022 at 2:39 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Sat, Jun 4, 2022 at 8:59 AM James Coleman <jtc331@gmail.com> wrote:
> > A quick background refresher: after promoting a standby rewinding the
> > former primary requires that a checkpoint have been completed on the
> > new primary after promotion. This is correctly documented. However
> > pg_rewind incorrectly reports to the user that a rewind isn't
> > necessary because the source and target are on the same timeline.
>
> Is there anything intrinsic to the mechanism of operation of pg_rewind
> that requires a timeline change, or could we just rewind within the
> same timeline to an earlier LSN? In other words, maybe we could just
> remove this limitation of pg_rewind, and then perhaps it wouldn't be
> necessary to determine what the new timeline is.

I think (someone can correct me if I'm wrong) that in theory the
mechanisms would support the source and target being on the same
timeline, but in practice that presents problems since you'd not have
an LSN you could detect as the divergence point. If we allowed passing
"rewind to" point LSN value, then that (again, as far as I understand
it) would work, but it's a different use case. Specifically I wouldn't
want that option to need to be used for this particular case since in
my example there is in fact a real divergence point that we should be
detecting automatically.

Thanks,
James Coleman



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Emit extra debug message when executing extension script.
Next
From: Tom Lane
Date:
Subject: Re: pg_rewind: warn when checkpoint hasn't happened after promotion