Re: Failing assertion while taking a restartpoint during crash recovery

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Failing assertion while taking a restartpoint during crash recovery
Date: 2026-08-15 17:14:32
Message-ID: CAHGQGwE0vbZWoQXR-q1orGDdiFCXE=nA1npNU1oQEbsAwB6FiQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 15, 2026 at 9:28 PM Imran Zaheer <imran(dot)zhir(at)gmail(dot)com> wrote:
> I agree that tracking whether StartupSUBTRANS() has actually been
> called is more direct and robust. I don't have any strong objection to
> your approach; your fix looks reasonable to me.

Thanks for the review!

I've applied the cosmetic changes to the patch and created patches
for the older branches.

> My initial concern was more about having too many recovery state
> management variables at this point, i.e., ArchiveRecoveryRequested,
> InArchiveRecovery, EnableHotStandby, StandbyMode,
> StandbyModeRequested, etc. I just wanted to keep the context close to
> the existing states and did not want to create a new state for this
> specific bug.

I agree that adding such new recovery state variables basically would
not be a good idea. But, I don't think the flag introduced by this patch
falls into that category. It simply tracks whether pg_subtrans has been
started during recovery, so I don't have much concern about adding it.

Regards,

--
Fujii Masao

Attachment Content-Type Size
v3-PG15-0001-Fix-checkpointer-restartpoint-assertion-failure.txt text/plain 4.1 KB
v3-0001-Fix-checkpointer-restartpoint-assertion-failure.patch application/octet-stream 4.1 KB
v3-PG14-0001-Fix-checkpointer-restartpoint-assertion-failure.txt text/plain 3.9 KB
v3-PG16_PG18-0001-Fix-checkpointer-restartpoint-assertion-failure.txt text/plain 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2026-08-15 17:45:32 Re: GIN VACUUM can corrupt internal posting tree pages
Previous Message Alvaro Herrera 2026-08-15 16:50:28 Re: Crashes on a partition whose concurrent detach never finished