pgsql: Improve comment about dropped entries in pgstat.c - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Improve comment about dropped entries in pgstat.c
Date
Msg-id E1tKWRE-001p53-UF@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/001a537b83ec6e2ab8fa8af44458b0502c94dd5e

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


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Improve the error message introduced in commit 87ce27de696.
Next
From: Michael Paquier
Date:
Subject: pgsql: Fix memory leak in pgoutput with publication list cache