Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record
Date
Msg-id CAHGQGwECpyJtMqkCEvyqgZDiwAeMj3RKobui7jONrDd35W0x3Q@mail.gmail.com
Whole thread Raw
In response to Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record
List pgsql-hackers
On Fri, Mar 6, 2026 at 8:46 AM Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Thu, Mar 5, 2026 at 5:40 PM Anthonin Bonnefoy
> <anthonin.bonnefoy@datadoghq.com> wrote:
> > So it was relying on GetInsertRecPtr() instead of
> > GetXLogInsertRecPtr(). As mentioned in the thread, GetInsertRecPtr()
> > only returns the position of the last full xlog page, meaning it
> > doesn't fix the issue we have where the last partial page contains a
> > continuation record.
> >
> > Testing the XLogFlush(GetInsertRecPtr()) patch with my script, I still
> > get the shutdown stuck issue.
> >
> > Using GetXLogInsertRecPtr() is required to make sure the last partial
> > page is correctly flushed.
>
> Since GetXLogInsertRecPtr() returns a bogus LSN and XLogFlush() does
> almost nothing during recovery, I added a !RecoveryInProgress() check
> as follows. I've attached the latest version of the patch and updated
> the commit message.
>
> - if (got_STOPPING)
> - XLogBackgroundFlush();
> + if (got_STOPPING && !RecoveryInProgress())
> + XLogFlush(GetXLogInsertRecPtr());

I've pushed the patch. Thanks!

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Rafia Sabih
Date:
Subject: Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement
Next
From: Chao Li
Date:
Subject: Re: DOC: fixes multiple errors in alter table doc