Skip to content

Commit

Permalink
Move CheckPoint_hook() call after CheckPointBuffers()
Browse files Browse the repository at this point in the history
That allows to process flushed buffers in CheckPoint_hook().
  • Loading branch information
akorotkov committed Oct 14, 2024
1 parent bf4510e commit 7e50554
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/access/transam/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -7041,8 +7041,6 @@ CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn, XLogRecPtr pagePtr,
static void
CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
{
if (CheckPoint_hook)
CheckPoint_hook(checkPointRedo, flags);
CheckPointRelationMap();
CheckPointReplicationSlots();
CheckPointSnapBuild();
Expand All @@ -7059,6 +7057,9 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
CheckPointPredicate();
CheckPointBuffers(flags);

if (CheckPoint_hook)
CheckPoint_hook(checkPointRedo, flags);

/* Perform all queued up fsyncs */
TRACE_POSTGRESQL_BUFFER_CHECKPOINT_SYNC_START();
CheckpointStats.ckpt_sync_t = GetCurrentTimestamp();
Expand Down

0 comments on commit 7e50554

Please sign in to comment.