Skip to content

Handle end-of-recovery checkpoints in Neon Postgres' startup code #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backend/access/transam/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -7220,7 +7220,7 @@ CheckPointReplicationState(void)
static void
PreCheckPointGuts(int flags)
{
if (flags & CHECKPOINT_IS_SHUTDOWN)
if (flags & (CHECKPOINT_IS_SHUTDOWN|CHECKPOINT_END_OF_RECOVERY))
{
CheckPointReplicationState();
CheckPointBuffers(flags);
Expand All @@ -7243,7 +7243,7 @@ PreCheckPointGuts(int flags)
static void
CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
{
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
if (!(flags & (CHECKPOINT_IS_SHUTDOWN|CHECKPOINT_END_OF_RECOVERY)))
CheckPointReplicationState();

/* Write out all dirty data in SLRUs and the main buffer pool */
Expand All @@ -7260,7 +7260,7 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
* Writing to the WAL during shutdown checkpoint cause Postgres panic.
* So do it before in PreCheckPointGuts.
*/
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
if (!(flags & (CHECKPOINT_IS_SHUTDOWN|CHECKPOINT_END_OF_RECOVERY)))
CheckPointBuffers(flags);

/* Perform all queued up fsyncs */
Expand Down