agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix data checksum progress counter initialization
Date: Fri, 10 Jul 2026 13:36:14 +0000
Message-ID: <E1wiBOn-000SBL-1w@gemulon.postgresql.org> (raw)
Fix data checksum progress counter initialization
pg_stat_progress_data_checksums uses -1 as a sentinel value that is
displayed as NULL for progress counters. However, after
pgstat_progress_start_command() initialized all progress counters to
zero, data checksum progress did not reset those counters to -1.
As a result, some counters could incorrectly appear as zero instead
of NULL. For example, workers could report zero database counters,
and the disabling launcher could report zero relation and block counters.
Also, blocks_done was not reset when a worker started processing
a new relation fork. As a result, it could temporarily exceed blocks_total
or report a stale value for an empty relation fork.
Fix this by initializing the data checksum progress counters to -1
when progress reporting starts for both launcher and worker processes.
Also reset blocks_done together with blocks_total when starting each
relation fork.
Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAHGQGwEOQyEzW2cqrHEzvwbcsAsuH8MEe7MMidFOFxECy0E1_Q@mail.gmail.com
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/9d1d91a14335392347e09a6cef2a45d8eafeebbd
Modified Files
--------------
doc/src/sgml/monitoring.sgml | 8 ++---
src/backend/catalog/system_views.sql | 2 +-
src/backend/postmaster/datachecksum_state.c | 53 ++++++++++++++++++++++-------
src/test/regress/expected/rules.out | 5 ++-
4 files changed, 50 insertions(+), 18 deletions(-)
view thread (2+ messages)
Message-ID: <E1wiBOn-000SBL-1w@gemulon.postgresql.org>
Permalink: ../E1wiBOn-000SBL-1w@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wiBOn-000SBL-1w@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: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix data checksum progress counter initialization
In-Reply-To: <E1wiBOn-000SBL-1w@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