pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: injection_points: Add proper locking when reporting fixed-variab
Date: Tue, 30 Sep 2025 00:03:08 +0000
Message-ID: <E1v3Npk-000hQW-0p@gemulon.postgresql.org> (raw)

injection_points: Add proper locking when reporting fixed-variable stats

Contrary to its siblings for the archiver, the bgwriter and the
checkpointer stats, pgstat_report_inj_fixed() can be called
concurrently.  This was causing an assertion failure, while messing up
with the stats.

This code is aimed at being a template for extension developers, so it
is not a critical issue, but let's be correct.  This module has also
been useful for some benchmarking, at least for me, and that was how I
have discovered this issue.

Oversight in f68cd847fa40.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: wenhui qiu <qiuwenhuifx@gmail.com>
Discussion: https://postgr.es/m/aNnXbAXHPFUWPIz2@paquier.xyz
Backpatch-through: 18

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/test/modules/injection_points/injection_stats_fixed.c | 4 ++++
1 file changed, 4 insertions(+)



view thread (2+ messages)

Message-ID: <E1v3Npk-000hQW-0p@gemulon.postgresql.org>
Permalink:  ../E1v3Npk-000hQW-0p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v3Npk-000hQW-0p@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 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: injection_points: Add proper locking when reporting fixed-variab
  In-Reply-To: <E1v3Npk-000hQW-0p@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