mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
Defer flushing of SLRU files.
Previously, we called fsync() after writing out individual pg_xact,
pg_multixact and pg_commit_ts pages due to cache pressure, leading to
regular I/O stalls in user backends and recovery. Collapse requests for
the same file into a single system call as part of the next checkpoint,
as we already did for relation files, using the infrastructure developed
by commit 3eb77eba. This can cause a significant improvement to
recovery performance, especially when it's otherwise CPU-bound.
Hoist ProcessSyncRequests() up into CheckPointGuts() to make it clearer
that it applies to all the SLRU mini-buffer-pools as well as the main
buffer pool. Rearrange things so that data collected in CheckpointStats
includes SLRU activity.
Also remove the Shutdown{CLOG,CommitTS,SUBTRANS,MultiXact}() functions,
because they were redundant after the shutdown checkpoint that
immediately precedes them. (I'm not sure if they were ever needed, but
they aren't now.)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (parts)
Tested-by: Jakub Wartak <Jakub.Wartak@tomtom.com>
Discussion: https://postgr.es/m/CA+hUKGLJ=84YT+NvhkEEDAuUtVHMfQ9i-N7k_o50JmQ6Rpj_OQ@mail.gmail.com
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#define CLOG_H
|
||||
|
||||
#include "access/xlogreader.h"
|
||||
#include "storage/sync.h"
|
||||
#include "lib/stringinfo.h"
|
||||
|
||||
/*
|
||||
@@ -50,6 +51,8 @@ extern void CheckPointCLOG(void);
|
||||
extern void ExtendCLOG(TransactionId newestXact);
|
||||
extern void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid);
|
||||
|
||||
extern int clogsyncfiletag(const FileTag *ftag, char *path);
|
||||
|
||||
/* XLOG stuff */
|
||||
#define CLOG_ZEROPAGE 0x00
|
||||
#define CLOG_TRUNCATE 0x10
|
||||
|
||||
Reference in New Issue
Block a user