public inbox for [email protected]  
help / color / mirror / Atom feed
From: Kyotaro Horiguchi <[email protected]>
To: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: [BUG] Panic due to incorrect missingContrecPtr after promotion
Date: Thu, 24 Feb 2022 16:26:42 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>

At Wed, 23 Feb 2022 02:58:07 +0000, "Imseih (AWS), Sami" <[email protected]> wrote in 
> >    Ooh, nice find and diagnosys.  I can confirm that the test fails as you
> >    described without the code fix, and doesn't fail with it.
> 
> >    I attach the same patch, with the test file put in its final place
> >    rather than as a patch.  Due to recent xlog.c changes this need a bit of
> >    work to apply to back branches; I'll see about getting it in all
> >    branches soon.
> 
> Thank you for reviewing!

Nice catch!  However, I'm not sure I like the patch.

 	 * made it through and start writing after the portion that persisted.
 	 * (It's critical to first write an OVERWRITE_CONTRECORD message, which
 	 * we'll do as soon as we're open for writing new WAL.)
+	 *
+	 * If the last wal record is ahead of the missing contrecord, this is a
+	 * recently promoted primary and we should not write an overwrite
+	 * contrecord.

Before the part, the comment follows the part shown below.

>	 * Actually, if WAL ended in an incomplete record, skip the parts that

So, actually WAL did not ended in an incomplete record.  I think
FinishWalRecover is the last place to do that. (But it could be
earlier.)

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center






view thread (4+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [BUG] Panic due to incorrect missingContrecPtr after promotion
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox