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: Improve comment about dropped entries in pgstat.c
Date: Mon, 09 Dec 2024 05:36:09 +0000
Message-ID: <E1tKWRE-001p5A-Vq@gemulon.postgresql.org> (raw)

Improve comment about dropped entries in pgstat.c

pgstat_write_statsfile() discards any entries marked as dropped from
being written to the stats file at shutdown, and also included an
assertion based on the same condition.

The intention of the assertion is to track that no pgstats entries
should be left around as terminating backends should drop any entries
they still hold references on before the stats file is written by the
checkpointer, and it not worth taking down the server in this case if
there is a bug making that possible.

Let's improve the comment of this area to document clearly what's
intended.

Based on a discussion with Bertrand Drouvot and Anton A. Melnikov.

Author: Bertrand Drouvot
Discussion: https://postgr.es/m/a13e8cdf-b97a-4ecb-8f42-aaa367974e29@postgrespro.ru
Backpatch-through: 15

Branch
------
REL_15_STABLE

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

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



view thread (4+ messages)  latest in thread

Message-ID: <E1tKWRE-001p5A-Vq@gemulon.postgresql.org>
Permalink:  ../E1tKWRE-001p5A-Vq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tKWRE-001p5A-Vq@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: Improve comment about dropped entries in pgstat.c
  In-Reply-To: <E1tKWRE-001p5A-Vq@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