Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Cc: Andres Freund <andres@anarazel.de>,
Alexander Lakhin <exclusion@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-16T23:16:08Z
Lists: pgsql-hackers
On Mon, Mar 16, 2026 at 6:45 PM Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> wrote: > > On Mon, Mar 16, 2026 at 6:39 AM Fujii Masao <masao.fujii@gmail.com> wrote: > > Since Tomas added GetXLogInsertEndRecPtr() in commit b1f14c96720, > > I updated the patch to use it. Patch attached. > > Barring any objections, I will commit it. > > > > - XLogFlush(GetXLogWriteRecPtr()); > > + XLogFlush(GetXLogInsertEndRecPtr()); > > Thanks for the updated patch! I've run my test script against the > patch and there's no more "xlog flush request xxx is not satisfied" > errors reported. Thanks for the test! I've pushed the patch. > > I excluded the above change from the patch because it seems like a separate > > issue. I also wonder whether this code could cause an error in XLogFlush() > > even when GetXLogWriteRecPtr() is used. > > Ha right, I've mixed Insert and Write and thought that > FinishSyncWorker was also doing a XlogFlush(GetXLogInsertRecPtr()) > when writing the patch. If I try to trigger the partial record issue, > GetXLogWriteRecPtr() points at the end of the WAL page containing the > beginning of the FPI_FOR_HINT, there's no attempt to flush in the > future. So FinishSyncWorker doesn't seem impacted by the issue. Understood. Thanks for the investigation! Regards, -- Fujii Masao
Commits
-
Fix WAL flush LSN used by logical walsender during shutdown
- f15471464650 14.23 landed
- fa9f2e317562 15.18 landed
- da21ecf5798c 16.14 landed
- 8ee536c89517 17.10 landed
- 9804981386a0 18.4 landed
- d927b4bd97c8 19 (unreleased) landed
-
Use GetXLogInsertEndRecPtr in gistGetFakeLSN
- b1f14c967202 19 (unreleased) cited
-
Fix publisher shutdown hang caused by logical walsender busy loop.
- 3bf6f22ce151 14.23 landed
- 42734f296615 15.18 landed
- 82935467a033 16.14 landed
- bbbc0888b356 17.10 landed
- 3eb2fecdbbfc 18.4 landed
- 6eedb2a5fd88 19 (unreleased) landed