From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix waiting in RegisterSyncRequest().
Date: Wed, 16 Mar 2022 02:49:14 +0000
Message-ID: <E1nUJis-000GEQ-Lm@gemulon.postgresql.org> (raw)
Fix waiting in RegisterSyncRequest().
If we run out of space in the checkpointer sync request queue (which is
hopefully rare on real systems, but common with very small buffer pool),
we wait for it to drain. While waiting, we should report that as a wait
event so that users know what is going on, and also handle postmaster
death, since otherwise the loop might never terminate if the
checkpointer has exited.
Back-patch to 12. Although the problem exists in earlier releases too,
the code is structured differently before 12 so I haven't gone any
further for now, in the absence of field complaints.
Reported-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20220226213942.nb7uvb2pamyu26dj%40alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3390ef1b7be28eac24dd95af23a4a287e6e7b1a4
Modified Files
--------------
doc/src/sgml/monitoring.sgml | 5 +++++
src/backend/storage/sync/sync.c | 4 +++-
src/backend/utils/activity/wait_event.c | 3 +++
src/include/utils/wait_event.h | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tmunro@postgresql.org
Subject: Re: pgsql: Fix waiting in RegisterSyncRequest().
In-Reply-To: <E1nUJis-000GEQ-Lm@gemulon.postgresql.org>
References: <E1nUJis-000GEQ-Lm@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox