Re: read stream on amcheck

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: read stream on amcheck
Date: 2025-03-27 00:48:21
Message-ID: CAAKRu_YGe3TATAi8V4Ya=Uwp1NDv3bV3QHYJKurgE-EpzQd5dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 17, 2025 at 9:47 AM Matheus Alcantara
<matheusssilv97(at)gmail(dot)com> wrote:
>
> Sorry for the delay, attached v4 with the remaining fixes.

Thanks for the patch.

I started reviewing this with the intent to commit it. But, I decided
while studying it that I want to separate the SKIP_PAGES_NONE case and
the other cases into two callbacks. I think it is easier to read the
skip pages callback this way. The SKIP_PAGES_NONE case is just read
all blocks in the range, so we can use the existing default callback,
block_range_read_cb(). Then the callback for the
SKIP_PAGES_ALL_VISIBLE and SKIP_PAGES_ALL_FROZEN options can be clear
and simple.

I've attached two versions with this proposed structure.

amcheck-readsteram-1callback.patch implements this with one callback
and has the amcheck specific callback private data struct subclass
BlockRangeReadStreamPrivate (I called it
heapamcheck_rs_perblock_data).

amcheck-readstream-2callbacks.patch wraps block_range_read_cb() in an
amcheck specific callback and creates a BlockRangeReadStreamPrivate
and fills it in from the heapamcheck_rs_perblock_data to pass as
callback_private_data. Because this version is more explicit, it is
more safe. We don't have any type checking facilities that will alert
us if someone adds a member above the BlockRangeReadStreamPrivate in
heapamcheck_rs_perblock_data. But, I'm open to feedback.

- Melanie

Attachment Content-Type Size
amcheck-readstream-2callbacks.patch text/x-patch 4.8 KB
amcheck-readstream-1callback.patch text/x-patch 4.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-03-27 00:58:56 Re: Partition pruning on parameters grouped into an array does not prune properly
Previous Message Jianghua Yang 2025-03-26 23:54:12 Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available