Handing off SLRU fsyncs to the checkpointer
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-12T08:54:16Z
Lists: pgsql-hackers
Attachments
- 0001-Use-the-checkpointer-to-fsync-SLRU-files.patch (application/octet-stream) patch 0001
Hi, In commit 3eb77eba we made it possible for any subsystem that wants a file to be flushed as part of the next checkpoint to ask the checkpointer to do that, as previously only md.c could do. In the past, foreground CLOG flush stalls were a problem, but then commit 33aaa139 cranked up the number of buffers, and then commit 5364b357 cranked it right up until the flushes mostly disappeared from some benchmark workload but not so high that the resulting linear searches through the buffer array destroyed the gains. I know there is interest in moving that stuff into regular shared buffers, so it can be found via the buffer mapping system (and improve as that improves), written back by the background writer (and improve as that improves), managed with a proper replacement algorithm (and improve as that improves), etc etc. That sounds like a great idea to me, but it's a big project. In the meantime, one thing we could do is hand off the fsyncs, but I'm not sure if it's still considered a real problem in the field given the new parameters. Anyway, I had a patch for that, that I used while testing commit 3eb77eba. While reading old threads about SLRU today I found that several people had wished for a thing exactly like that, so I dusted it off and rebased it.
Commits
-
Remove unused function prototypes.
- 87c23d36a3bc 14.0 landed
-
Defer flushing of SLRU files.
- dee663f78439 14.0 landed
-
Improve the vacuum error context phase information.
- a3c66de6c5e1 14.0 cited
-
Cache smgrnblocks() results in recovery.
- c5315f4f4484 14.0 cited
-
Refactor the fsync queue for wider use.
- 3eb77eba5a51 12.0 cited
-
Increase maximum number of clog buffers.
- 5364b357fb11 9.6.0 cited
-
Make the number of CLOG buffers adaptive, based on shared_buffers.
- 33aaa139e630 9.2.0 cited
-
Replace implementation of pg_log as a relation accessed through the
- 2589735da08c 7.2.1 cited