Re: Fix primary crash continually with invalid checkpoint after promote

2022-04-27 Thread Nathan Bossart
On Tue, Apr 26, 2022 at 03:16:13PM +0800, Zhao Rui wrote: > 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 l

Fix primary crash continually with invalid checkpoint after promote

2022-04-27 Thread Zhao Rui
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: "inva

Re: Fix primary crash continually with invalid checkpoint after promote

2022-04-26 Thread Michael Paquier
On Wed, Apr 27, 2022 at 11:24:11AM +0900, Kyotaro Horiguchi wrote: > Zhao Rui's proposal is retension of WAL files according to (the wrong > content of) control file. > > Aside from the fact that it may let slots be invalidated ealier, It's > not great that an acutally performed restartpoint is fo

Re: Fix primary crash continually with invalid checkpoint after promote

2022-04-26 Thread Kyotaro Horiguchi
At Tue, 26 Apr 2022 15:47:13 -0400, Tom Lane wrote in > "=?ISO-8859-1?B?WmhhbyBSdWk=?=" <875941...@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

Re: Fix primary crash continually with invalid checkpoint after promote

2022-04-26 Thread Tom Lane
"=?ISO-8859-1?B?WmhhbyBSdWk=?=" <875941...@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 produc