Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions src/backend/access/transam/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ restore_running_xacts_callback_t restore_running_xacts_callback;
set_lwlsn_db_hook_type set_lwlsn_db_hook = NULL;
set_lwlsn_relation_hook_type set_lwlsn_relation_hook = NULL;
set_max_lwlsn_hook_type set_max_lwlsn_hook = NULL;
flush_dirty_buffers_hook_type flush_dirty_buffers_hook = NULL;

/*
* Number of WAL insertion locks to use. A higher value allows more insertions
Expand Down Expand Up @@ -10163,10 +10164,20 @@ CreateRestartPoint(int flags)
ControlFile->time = (pg_time_t) time(NULL);
UpdateControlFile();
LWLockRelease(ControlFileLock);

if (flush_dirty_buffers_hook)
{
flush_dirty_buffers_hook(flags);
}
}
return false;
}

if (flush_dirty_buffers_hook)
{
flush_dirty_buffers_hook(flags);
}

/*
* Update the shared RedoRecPtr so that the startup process can calculate
* the number of segments replayed since last restartpoint, and request a
Expand Down
3 changes: 3 additions & 0 deletions src/include/access/xlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ extern set_lwlsn_db_hook_type set_lwlsn_db_hook;
extern set_lwlsn_relation_hook_type set_lwlsn_relation_hook;
extern set_max_lwlsn_hook_type set_max_lwlsn_hook;

typedef void (*flush_dirty_buffers_hook_type)(int flags);
extern flush_dirty_buffers_hook_type flush_dirty_buffers_hook;

extern XLogRecPtr GetRedoStartLsn(void);

extern bool PromoteIsTriggered(void);
Expand Down
Loading