Re: pg_rewind: warn when checkpoint hasn't happened after promotion

From: James Coleman <jtc331(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_rewind: warn when checkpoint hasn't happened after promotion
Date: 2022-07-05 18:46:13
Message-ID: CAAaqYe9L_c1Z6qsXGXSQ7_d=U3HA1N0uJGLz_MW40zZwvB-FtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 5, 2022 at 2:39 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Sat, Jun 4, 2022 at 8:59 AM James Coleman <jtc331(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-05 18:47:27 Re: pg_rewind: warn when checkpoint hasn't happened after promotion
Previous Message Robert Haas 2022-07-05 18:43:33 Re: Emit extra debug message when executing extension script.