Re: Fix pg_stat_progress_data_checksums counter initialization

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix pg_stat_progress_data_checksums counter initialization
Date: 2026-07-10 08:29:15
Message-ID: A0818CBB-8BBE-404E-94D7-15471BE85271@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 10 Jul 2026, at 09:13, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> The attached patch fixes this by initializing all data checksum progress
> counters to -1 immediately after progress reporting starts for both
> launcher and worker processes.
>
> While looking at this code, I also found that blocks_done is not reset
> when a worker starts processing a new relation fork. As a result,
> blocks_done can temporarily exceed blocks_total, or a stale blocks_done
> value can remain visible for an empty relation fork. The attached patch
> resets blocks_done together with blocks_total when starting each
> relation fork.

LGTM, thanks!

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-07-10 08:32:22 Re: Fix data checksum processing for temp relations and dropped databases
Previous Message Shlok Kyal 2026-07-10 08:28:10 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade