agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove incomplete pgstats entry for allocation failure at startu
Date: Tue, 08 Sep 2026 05:12:39 +0000
Message-ID: <E1x3o8M-00000003wPV-0yBs@gemulon.postgresql.org> (raw)

Remove incomplete pgstats entry for allocation failure at startup

pgstat_init_entry() can fail after its hash entry has been inserted, in
which case the caller has to remove the entry, as done by
pgstat_get_entry_ref() since 8191e0c16a03.  pgstat_read_statsfile() was
not exactly doing that, leaving an entry that could still point to an
InvalidDsaPointer.

There are no consequences here, even after 8191e0c16a03.  The stats are
loaded from disk by the startup process, where an ERROR gets promoted to
a FATAL, cleaning up shared memory.  So this is mostly an argument of
consistency with the normal entry creation path, especially if someone
decides to downgrade this ERROR to a WARNING in pgstat_read_statsfile().

Author: Grigorev Jurij <ju.grigorev@ftdata.ru>
Discussion: https://postgr.es/m/d55ecaf911844d53bd0a931751dce582@localhost.localdomain

Branch
------
master

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

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



Message-ID: <E1x3o8M-00000003wPV-0yBs@gemulon.postgresql.org>
Permalink:  ../E1x3o8M-00000003wPV-0yBs@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x3o8M-00000003wPV-0yBs@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: Remove incomplete pgstats entry for allocation failure at startu
  In-Reply-To: <E1x3o8M-00000003wPV-0yBs@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox