Re: Fix primary crash continually with invalid checkpoint after promote - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix primary crash continually with invalid checkpoint after promote
Date
Msg-id 258772.1651002433@sss.pgh.pa.us
Whole thread Raw
In response to Fix primary crash continually with invalid checkpoint after promote  ("Zhao Rui" <875941708@qq.com>)
Responses Re: Fix primary crash continually with invalid checkpoint after promote  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
"=?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
fileis not updated, old wals are still removed. Thus produces an invalid checkpoint with nonexistent wal. Crucial log:
"invalidprimary 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.com

but Horiguchi-san's proposed fix looks quite different from yours.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Possible corruption by CreateRestartPoint at promotion
Next
From: Nathan Bossart
Date:
Subject: Re: avoid multiple hard links to same WAL file after a crash