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: Add assertion in pgstat_write_statsfile() about processes allowe
Date: Fri, 12 Jul 2024 06:12:34 +0000
Message-ID: <E1sS9WE-001LHC-Qh@gemulon.postgresql.org> (raw)

Add assertion in pgstat_write_statsfile() about processes allowed

This routine can currently only be called from the postmaster in
single-user mode or the checkpointer, but there was no sanity check to
make sure that this was always the case.

This has proved to be useful when hacking the zone (at least to me), to
make sure that the write of the pgstats file happens at shutdown, as
wanted by design, in the correct process context.

Discussion: https://postgr.es/m/ZnEiqAITL-VgZDoY@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/734c057a8935fca10ff67173c8b969ef799ea7d2

Modified Files
--------------
src/backend/utils/activity/pgstat.c | 3 +++
1 file changed, 3 insertions(+)



Message-ID: <E1sS9WE-001LHC-Qh@gemulon.postgresql.org>
Permalink:  ../E1sS9WE-001LHC-Qh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sS9WE-001LHC-Qh@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: Add assertion in pgstat_write_statsfile() about processes allowe
  In-Reply-To: <E1sS9WE-001LHC-Qh@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