Re: Corruption during WAL replay

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: deniel1495(at)mail(dot)ru
Cc: robertmhaas(at)gmail(dot)com, ibrar(dot)ahmad(at)gmail(dot)com, tejeswarm(at)hotmail(dot)com, andres(at)anarazel(dot)de, hlinnaka(at)iki(dot)fi, masahiko(dot)sawada(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, hexexpert(at)comcast(dot)net
Subject: Re: Corruption during WAL replay
Date: 2022-01-26 08:25:33
Message-ID: 20220126.172533.404912466361180867.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Mon, 24 Jan 2022 23:33:20 +0300, Daniel Shelepanov <deniel1495(at)mail(dot)ru> wrote in
> Hi. This is my first attempt to review a patch so feel free to tell me
> if I missed something.

Welcome!

> As of today's state of REL_14_STABLE
> (ef9706bbc8ce917a366e4640df8c603c9605817a), the problem is
> reproducible using the script provided by Daniel Wood in this
> (1335373813(dot)287510(dot)1573611814107(at)connect(dot)xfinity(dot)com) message. Also,
> the latest patch seems not to be applicable and requires some minor
> tweaks.

Thanks for the info. The reason for my failure is checksum was
enabled.. After disalbing both fpw and checksum (and wal_log_hints)
allows me to reproduce the issue. And what I found is:

v3 patch:
> vxids = GetVirtualXIDsDelayingChkpt(&nvxids, DELAY_CHKPT_COMPLETE);
!> if (0 && nvxids > 0)
> {

Ugggggggh! It looks like a debugging tweak but it prevents everything
from working.

The attached is the fixed version and it surely works with the repro.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v4-0001-Delay-checkpoint-completion-until-truncation-comp.patch text/x-patch 14.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2022-01-26 09:32:54 RE: logical replication empty transactions
Previous Message Michail Nikolaev 2022-01-26 07:49:55 Re: [PATCH] Full support for index LP_DEAD hint bits on standby