Re: standby promotion can create unreadable WAL

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: dilipbalaut(at)gmail(dot)com
Cc: robertmhaas(at)gmail(dot)com, alvherre(at)alvh(dot)no-ip(dot)org, pgsql-hackers(at)postgresql(dot)org, andres(at)anarazel(dot)de
Subject: Re: standby promotion can create unreadable WAL
Date: 2022-08-29 04:13:52
Message-ID: 20220829.131352.1390194912445731838.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Sun, 28 Aug 2022 10:16:21 +0530, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote in
> On Fri, Aug 26, 2022 at 7:53 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > v2 attached.
>
> The patch LGTM, this patch will apply on master and v15. PFA patch
> for back branches.

StandbyMode is obviously wrong. On the other hand I thought that
!ArchiveRecoveryRequested is somewhat wrong, too (, as I stated in the
pointed thread). On second thought, I changed my mind that it is
right. After aborted contrec is found, The cause of the confusion is
that I somehow thought that archive recovery continues from the
aborted-contrec record. However, that assumption is wrong. The next
redo starts from the beginning of the aborted contrecord so we should
forget abouat the old missing/aborted contrec info when archive
recovery is requested.

In the end, the point is that we need to set the global variables only
when XLogPrefetcherReadRecord() (or XLogReadRecord()) returns NULL and
we return it to the caller. Is it worth to do a small refactoring
like the attached? If no, I'm fine with the proposed patch including
the added assertion.

# I havent reproduce the issue of the OP in the other thread yet, and
# also not found how to reproduce this issue, though..

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
refactor_abrtcontrec_set.txt text/plain 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-08-29 04:21:17 Re: standby promotion can create unreadable WAL
Previous Message kuroda.hayato@fujitsu.com 2022-08-29 03:18:14 patch: Add missing descriptions for rmgr APIs