Re: Count the last block of the validation scan in CIC progress

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Manu <manuelreyesbravo(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Count the last block of the validation scan in CIC progress
Date: 2026-10-26 22:53:01
Message-ID: at_ZzYdXakqr-Yib@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 26, 2026 at 02:21:00PM -0300, Manu wrote:
> heapam_index_validate_scan() reports each block when the scan starts
> on it and nothing when the scan ends, so the last block is never
> counted, and the phases that follow do not touch the block counters.

Hmm, yeah, it looks like you are right here. We aggregate a block
when we start scanning it, meaning that we're missing one block at the
end.

Adding one progress call at the end of the callback routine sounds
like the correct thing to do. I doubt that this is worth bothering
outside of HEAD, it's just a slight correctness issue, annoying but
not critical even if the waits can be long depending on the
transaction activity.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-10-26 23:06:48 Re: WAL record CRC calculated incorrectly because of underlying buffer modification
Previous Message Jeff Davis 2026-10-26 22:15:50 Re: [PG19] ILIKE index scan misses rows with a libc UTF-8 collation on macOS