From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Clean up latch related code.
Date: Tue, 06 Jun 2017 23:59:12 +0000
Message-ID: <E1dIONU-00049Z-0t@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Clean up latch related code.
The larger part of this patch replaces usages of MyProc->procLatch
with MyLatch. The latter works even early during backend startup,
where MyProc->procLatch doesn't yet. While the affected code
shouldn't run in cases where it's not initialized, it might get copied
into places where it might. Using MyLatch is simpler and a bit faster
to boot, so there's little point to stick with the previous coding.
While doing so I noticed some weaknesses around newly introduced uses
of latches that could lead to missed events, and an omitted
CHECK_FOR_INTERRUPTS() call in worker_spi.
As all the actual bugs are in v10 code, there doesn't seem to be
sufficient reason to backpatch this.
Author: Andres Freund
Discussion:
https://postgr.es/m/20170606195321.sjmenrfgl2nu6j63@alap3.anarazel.dehttps://postgr.es/m/20170606210405.sim3yl6vpudhmufo@alap3.anarazel.de
Backpatch: -
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9206ced1dc05d3a9cc99faafa22d5d8b16d998d1
Modified Files
--------------
src/backend/access/transam/parallel.c | 4 +--
src/backend/libpq/pqmq.c | 4 +--
src/backend/postmaster/bgworker.c | 4 +--
.../libpqwalreceiver/libpqwalreceiver.c | 13 ++++----
src/backend/replication/logical/launcher.c | 35 +++++++++++++++-------
src/backend/replication/logical/tablesync.c | 12 ++++----
src/backend/replication/logical/worker.c | 10 +++++--
src/backend/storage/lmgr/condition_variable.c | 6 ++--
src/test/modules/worker_spi/worker_spi.c | 2 ++
9 files changed, 56 insertions(+), 34 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: andres@anarazel.de
Subject: Re: pgsql: Clean up latch related code.
In-Reply-To: <E1dIONU-00049Z-0t@gemulon.postgresql.org>
References: <E1dIONU-00049Z-0t@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