Re: PITR promote bug: Checkpointer writes to older timeline

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: masao(dot)fujii(at)oss(dot)nttdata(dot)com
Cc: soumyadeep2007(at)gmail(dot)com, hlinnaka(at)iki(dot)fi, pgsql-hackers(at)postgresql(dot)org, michael(at)paquier(dot)xyz, jyih(at)vmware(dot)com, kyeap(at)vmware(dot)com
Subject: Re: PITR promote bug: Checkpointer writes to older timeline
Date: 2021-03-04 08:10:36
Message-ID: 20210304.171036.110427976294651859.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 4 Mar 2021 14:57:13 +0900, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
> > read_local_xlog_page() works as a part of logical decoding and has
> > responsibility to update ThisTimeLineID properly. As the comment in
> > the function, it is the proper place to update ThisTimeLineID since we
> > miss a timeline change if we check it earlier and the function uses
> > the value just after. So we cannot change that behavior of the
> > function. That is, neither of them doesn't seem to be the right fix.
>
> Could you tell me what actual issue happens if read_local_xlog_page()
> resets
> ThisTimeLineID at the end? Some replication slot-related functions
> that use
> read_local_xlog_page() can be executed even during recovery. For
> example,
> you mean that, when timeline swithes during recovery, those functions
> behave incorrectly if ThisTimeLineID is reset?

The most significant point for me was I'm not fully convinced that we
can safely (or validly) remove the fucntion to maintain the variable
from read_local_xlog_page.

> * RecoveryInProgress() will update ThisTimeLineID when it first
> * notices recovery finishes, so we only have to maintain it for the
> * local process until recovery ends.

read_local_xlog_page is *designed* to maintain ThisTimeLineID.
Currently it doesn't seem utilized but I think it's sufficiently
reasonable that the function maintains ThisTimeLineID.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-03-04 08:15:05 Re: OpenSSL 3.0.0 compatibility
Previous Message Michael Paquier 2021-03-04 08:10:03 Re: Track replica origin progress for Rollback Prepared