From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zhao Rui <875941708@qq.com>
Cc: pgsql-hackers@lists.postgresql.org, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: masao.fujii@oss.nttdata.com, Nathan Bossart <nathandbossart@gmail.com>
Subject: Re: Fix primary crash continually with invalid checkpoint after promote
Date: Tue, 26 Apr 2022 15:47:13 -0400
Message-ID: <258772.1651002433@sss.pgh.pa.us> (raw)
In-Reply-To: <tencent_1D53DA1DFA2F5EF11B0D6B9DD24FF8BD4A08@qq.com>
References: <tencent_1D53DA1DFA2F5EF11B0D6B9DD24FF8BD4A08@qq.com>
"=?ISO-8859-1?B?WmhhbyBSdWk=?=" <875941708@qq.com> writes:
> Newly promoted primary may leave an invalid checkpoint.
> In function CreateRestartPoint, control file is updated and old wals are removed. But in some situations, control file is not updated, old wals are still removed. Thus produces an invalid checkpoint with nonexistent wal. Crucial log: "invalid primary checkpoint record", "could not locate a valid checkpoint record".
I believe this is the same issue being discussed here:
https://www.postgresql.org/message-id/flat/20220316.102444.2193181487576617583.horikyota.ntt%40gmail...
but Horiguchi-san's proposed fix looks quite different from yours.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, 875941708@qq.com, horikyota.ntt@gmail.com, nathandbossart@gmail.com
Subject: Re: Fix primary crash continually with invalid checkpoint after promote
In-Reply-To: <258772.1651002433@sss.pgh.pa.us>
* 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