postgresql/src/backend/postmaster
Thomas Munro 78c0f85e43 Wake up for latches in CheckpointWriteDelay().
The checkpointer shouldn't ignore its latch.  Other backends may be
waiting for it to drain the request queue.  Hopefully real systems don't
have a full queue often, but the condition is reached easily when
shared_buffers is small.

This involves defining a new wait event, which will appear in the
pg_stat_activity view often due to spread checkpoints.

Back-patch only to 14.  Even though the problem exists in earlier
branches too, it's hard to hit there.  In 14 we stopped using signal
handlers for latches on Linux, *BSD and macOS, which were previously
hiding this problem by interrupting the sleep (though not reliably, as
the signal could arrive before the sleep begins; precisely the problem
latches address).

Reported-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20220226213942.nb7uvb2pamyu26dj%40alap3.anarazel.de
2022-03-16 13:57:07 +13:00
..
autovacuum.c Make autovacuum launcher more responsive to pg_log_backend_memory_contexts(). 2021-10-12 09:51:17 +09:00
bgworker.c Be more careful about barriers when releasing BackgroundWorkerSlots. 2021-05-15 12:21:06 -04:00
bgwriter.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
checkpointer.c Wake up for latches in CheckpointWriteDelay(). 2022-03-16 13:57:07 +13:00
fork_process.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
interrupt.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Partially deduplicate interrupt handling for background processes. 2019-12-17 13:14:28 -05:00
pgarch.c Make archiver process handle barrier events. 2021-06-18 17:57:09 +09:00
pgstat.c Fix performance regression from session statistics. 2021-09-16 02:10:57 -07:00
postmaster.c Suppress warning about stack_base_ptr with late-model GCC. 2022-02-17 22:45:34 -05:00
startup.c Shut down transaction tracking at startup process exit. 2021-04-06 02:25:37 +09:00
syslogger.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
walwriter.c Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00