From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve locking around InjectionPointRun()
Date: Fri, 28 Jun 2024 03:33:11 +0000
Message-ID: <E1sN2MI-003JWQ-Bi@gemulon.postgresql.org> (raw)
Improve locking around InjectionPointRun()
As coded, an injection point could be loaded into the local cache
without the LWLock InjectionPointLock taken, hence a point detached and
re-attached concurrently of a point running calling InjectionPointRun()
may finish by loading a callback it did no set initially. Based on all
the cases discussed until now on the lists, it is fine to delay the lock
release until the callback is run, so let's do that.
While on it, remove a useless LWLockRelease() called before an error in
InjectionPointAttach().
Per discussion with Heikki Linnakangas and Noah Misch.
Discussion: https://postgr.es/m/e1ffb822-054e-4006-ac06-50532767f75b@iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d85fc4be11b38afd6d3abb586a6799299ed29470
Modified Files
--------------
src/backend/utils/misc/injection_point.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Improve locking around InjectionPointRun()
In-Reply-To: <E1sN2MI-003JWQ-Bi@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