pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove CheckpointLock.
Date: Mon, 25 Jan 2021 17:38:22 +0000
Message-ID: <E1l45ok-0005e2-Lw@gemulon.postgresql.org> (raw)

Remove CheckpointLock.

Up until now, we've held this lock when performing a checkpoint or
restartpoint, but commit 076a055acf3c55314de267c62b03191586d79cf6 back
in 2004 and commit 7e48b77b1cebb9a43f9fdd6b17128a0ba36132f9 from 2009,
taken together, have removed all need for this. In the present code,
there's only ever one process entitled to attempt a checkpoint: either
the checkpointer, during normal operation, or the postmaster, during
single-user operation. So, we don't need the lock.

One possible concern in making this change is that it means that
a substantial amount of code where HOLD_INTERRUPTS() was previously
in effect due to the preceding LWLockAcquire() will now be
running without that. This could mean that ProcessInterrupts()
gets called in places from which it didn't before. However, this
seems unlikely to do very much, because the checkpointer doesn't
have any signal mapped to die(), so it's not clear how,
for example, ProcDiePending = true could happen in the first
place. Similarly with ClientConnectionLost and recovery conflicts.

Also, if there are any such problems, we might want to fix them
rather than reverting this, since running lots of code with
interrupt handling suspended is generally bad.

Patch by me, per an inquiry by Amul Sul. Review by Tom Lane
and Michael Paquier.

Discussion: http://postgr.es/m/CAAJ_b97XnBBfYeSREDJorFsyoD1sHgqnNuCi=02mNQBUMnA=FA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d18e75664a2fda2e4d5cc433d68e37fc0e9499f2

Modified Files
--------------
doc/src/sgml/monitoring.sgml             |  4 ----
src/backend/access/heap/rewriteheap.c    |  4 ++--
src/backend/access/transam/xlog.c        | 28 +---------------------------
src/backend/replication/logical/origin.c |  4 ++--
src/backend/storage/lmgr/lwlocknames.txt |  2 +-
5 files changed, 6 insertions(+), 36 deletions(-)



Message-ID: <E1l45ok-0005e2-Lw@gemulon.postgresql.org>
Permalink:  ../E1l45ok-0005e2-Lw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l45ok-0005e2-Lw@gemulon.postgresql.org

 · 

reply

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: rhaas@postgresql.org
  Subject: Re: pgsql: Remove CheckpointLock.
  In-Reply-To: <E1l45ok-0005e2-Lw@gemulon.postgresql.org>
  References: <E1l45ok-0005e2-Lw@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