From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: masao.fujii@oss.nttdata.com
Cc: andres@anarazel.de
Cc: pgsql-hackers@lists.postgresql.org
Cc: bossartn@amazon.com
Cc: mengjuan.cmj@alibaba-inc.com
Cc: Jakub.Wartak@tomtom.com
Subject: Re: prevent immature WAL streaming
Date: Fri, 3 Sep 2021 13:35:32 -0400
Message-ID: <202109031735.lhfhywziaksp@alvherre.pgsql> (raw)
In-Reply-To: <20210903.160904.904317102157226316.horikyota.ntt@gmail.com>
On 2021-Sep-03, Kyotaro Horiguchi wrote:
> At Thu, 2 Sep 2021 18:43:33 -0400, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
> The name sounds like the start LSN. doesn't contrecordAbort(ed)Ptr work?
>
> > if (!(pageHeader->xlp_info & XLP_FIRST_IS_CONTRECORD))
> > {
> > report_invalid_record(state,
> > "there is no contrecord flag at %X/%X",
> > LSN_FORMAT_ARGS(RecPtr));
> > + goto aborted_contrecord;
>
> This loses the exclusion check between XLP_FIRST_IS_CONTRECORD and
> _IS_ABROTED_PARTIAL. Is it okay? (I don't object to remove the check.).
On second thought, I'm not sure that we should make xlogreader report an
invalid record here. If we do, how is the user going to recover?
Recovery will stop there and lose whatever was written afterwards.
Maybe you could claim that if both bits are set then WAL is corrupted,
so it's okay to stop recovery. But if WAL is really corrupted, then the
CRC check will fail. All in all, I think I'd rather ignore the flag if
we see it set.
At most, we could have an
#ifndef FRONTEND
ereport(WARNING, "found unexpected flag xyz");
#endif
or something like that. However, xlogreader does not currently have
anything like that, so I'm not completely sure.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, horikyota.ntt@gmail.com, masao.fujii@oss.nttdata.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org, bossartn@amazon.com, mengjuan.cmj@alibaba-inc.com, Jakub.Wartak@tomtom.com
Subject: Re: prevent immature WAL streaming
In-Reply-To: <202109031735.lhfhywziaksp@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox