pgsql: Defer flushing of SLRU files.
От | Thomas Munro |
---|---|
Тема | pgsql: Defer flushing of SLRU files. |
Дата | |
Msg-id | E1kLhn6-0006gM-6i@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/dee663f7843902535a15ae366cede8b4089f1144 Modified Files -------------- src/backend/access/transam/clog.c | 40 ++++----- src/backend/access/transam/commit_ts.c | 36 ++++---- src/backend/access/transam/multixact.c | 57 ++++++------ src/backend/access/transam/slru.c | 154 +++++++++++++++++++++++---------- src/backend/access/transam/subtrans.c | 25 +----- src/backend/access/transam/xlog.c | 28 +++--- src/backend/commands/async.c | 5 +- src/backend/storage/buffer/bufmgr.c | 7 -- src/backend/storage/lmgr/predicate.c | 8 +- src/backend/storage/sync/sync.c | 28 +++++- src/include/access/clog.h | 3 + src/include/access/commit_ts.h | 3 + src/include/access/multixact.h | 4 + src/include/access/slru.h | 14 +-- src/include/storage/sync.h | 7 +- src/tools/pgindent/typedefs.list | 5 +- 16 files changed, 252 insertions(+), 172 deletions(-)
В списке pgsql-committers по дате отправления: