pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgstat: Use correct lock level in pgstat_drop_all_entries().
Date: Sat, 16 Apr 2022 21:48:30 +0000
Message-ID: <E1nfqHO-000pxR-1q@gemulon.postgresql.org> (raw)

pgstat: Use correct lock level in pgstat_drop_all_entries().

Previously we didn't, which lead to an assertion failure when resetting
partially loaded statistics. This was encountered on the buildfarm, for
as-of-yet unknown reasons.

Ttighten up a validity check when reading the stats file, verifying 'E'
signals the end of the file (rather than just stopping reading). That's then
used in a test appending to the stats file that crashed before the fix in
pgstat_drop_all_entries().

Reported by buildfarm animals mylodon and kestrel, via Tom Lane.

Discussion: https://postgr.es/m/1656446.1650043715@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4a736a161c306fcfed970e6b649f2f03f465ac24

Modified Files
--------------
src/backend/utils/activity/pgstat.c       |  4 ++++
src/backend/utils/activity/pgstat_shmem.c |  2 +-
src/test/recovery/t/029_stats_restart.pl  | 30 ++++++++++++++++++++++++++++--
3 files changed, 33 insertions(+), 3 deletions(-)



Message-ID: <E1nfqHO-000pxR-1q@gemulon.postgresql.org>
Permalink:  ../E1nfqHO-000pxR-1q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nfqHO-000pxR-1q@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: pgstat: Use correct lock level in pgstat_drop_all_entries().
  In-Reply-To: <E1nfqHO-000pxR-1q@gemulon.postgresql.org>
  References: <E1nfqHO-000pxR-1q@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