Re: Corruption during WAL replay

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: deniel1495(at)mail(dot)ru, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, tejeswarm(at)hotmail(dot)com, Andres Freund <andres(at)anarazel(dot)de>, hlinnaka <hlinnaka(at)iki(dot)fi>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Daniel Wood <hexexpert(at)comcast(dot)net>
Subject: Re: Corruption during WAL replay
Date: 2022-03-16 14:14:56
Message-ID: CA+TgmobNVosCR02Wpfa2QFnGwu66b81BcX+r2T_6u719E9wBwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 16, 2022 at 1:14 AM Kyotaro Horiguchi
<horikyota(dot)ntt(at)gmail(dot)com> wrote:
> storage.c:
> + * Make sure that a concurrent checkpoint can't complete while truncation
> + * is in progress.
> + *
> + * The truncation operation might drop buffers that the checkpoint
> + * otherwise would have flushed. If it does, then it's essential that
> + * the files actually get truncated on disk before the checkpoint record
> + * is written. Otherwise, if reply begins from that checkpoint, the
> + * to-be-truncated buffers might still exist on disk but have older
> + * contents than expected, which can cause replay to fail. It's OK for
> + * the buffers to not exist on disk at all, but not for them to have the
> + * wrong contents.
>
> FWIW, this seems like slightly confusing between buffer and its
> content. I can read it correctly so I don't mind if it is natural
> enough.

Hmm. I think the last two instances of "buffers" in this comment
should actually say "blocks".

> I'll try that, if you are already working on it, please inform me. (It
> may more than likely be too late..)

If you want to take a crack at that, I'd be delighted.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-03-16 14:25:09 Re: ICU for global collation
Previous Message Robert Haas 2022-03-16 14:08:45 Re: Optimize external TOAST storage