From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: pgstat: add/extend tests for resetting various kinds of stats.
Date: Thu, 15 Sep 2022 15:59:52 -0400
Message-ID: <3428246.1663271992@sss.pgh.pa.us> (raw)
In-Reply-To: <E1ncazy-000nql-Sq@gemulon.postgresql.org>
References: <E1ncazy-000nql-Sq@gemulon.postgresql.org>
Andres Freund <andres@anarazel.de> writes:
> pgstat: add/extend tests for resetting various kinds of stats.
crake just failed [1] with what appears to be a race condition in
a test case added by this commit:
inline patch 1: /home/andrew/bf/root/HEAD/pgsql.build/src/test/recovery/tmp_check/results/stats.out (+1/-1 lines) download inline-1.patchdiff -U3 /home/andrew/bf/root/HEAD/pgsql/src/test/regress/expected/stats.out /home/andrew/bf/root/HEAD/pgsql.build/src/test/recovery/tmp_check/results/stats.out
--- /home/andrew/bf/root/HEAD/pgsql/src/test/regress/expected/stats.out 2022-07-18 13:32:25.155847949 -0400+++ /home/andrew/bf/root/HEAD/pgsql.build/src/test/recovery/tmp_check/results/stats.out 2022-09-15 12:44:10.022975164 -0400@@ -563,7 +563,7 @@
SELECT sessions > :db_stat_sessions FROM pg_stat_database WHERE datname = (SELECT current_database());
?column?
----------
- t+ f
(1 row)
-- Test pg_stat_bgwriter checkpointer-related stats, together with pg_stat_wal
It seems likely to me that the n_sessions increment hasn't made it to
shared memory because some background process happened to have a lock on
the stats entry when we tried. Don't we need a pg_stat_force_next_flush()
call before trying to inspect the sessions count?
BTW, the header comment for pgstat_report_stat is badly in need of
copy-editing.
regards, tom lane
[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=crake&dt=2022-09-15%2016%3A18%3A30
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: tgl@sss.pgh.pa.us, andres@anarazel.de
Subject: Re: pgsql: pgstat: add/extend tests for resetting various kinds of stats.
In-Reply-To: <3428246.1663271992@sss.pgh.pa.us>
References: <E1ncazy-000nql-Sq@gemulon.postgresql.org> <3428246.1663271992@sss.pgh.pa.us>
* 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