postgresql/src/backend/storage
Thomas Munro dee663f784 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
2020-09-25 19:00:15 +12:00
..
buffer Defer flushing of SLRU files. 2020-09-25 19:00:15 +12:00
file Skip unnecessary stat() calls in walkdir(). 2020-09-07 18:28:06 +12:00
freespace Cache smgrnblocks() results in recovery. 2020-07-31 14:29:52 +12:00
ipc Allow WaitLatch() to be used without a latch. 2020-09-23 15:17:30 +12:00
large_object Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
lmgr Defer flushing of SLRU files. 2020-09-25 19:00:15 +12:00
page Optimize compactify_tuples function 2020-09-16 13:22:20 +12:00
smgr remove redundant initializations 2020-09-03 22:57:35 -04:00
sync Defer flushing of SLRU files. 2020-09-25 19:00:15 +12:00
Makefile Refactor the fsync queue for wider use. 2019-04-04 23:38:38 +13:00