Re: Confine vacuum skip logic to lazy_scan_skip - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Confine vacuum skip logic to lazy_scan_skip
Date
Msg-id CAAKRu_arSnZdXryWxZ6CqmR631Xs3LOptVOyoKoBbzh7_xbeJA@mail.gmail.com
Whole thread Raw
In response to Re: Confine vacuum skip logic to lazy_scan_skip  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Confine vacuum skip logic to lazy_scan_skip
List pgsql-hackers
On Thu, Feb 27, 2025 at 1:08 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I wonder if it'd be a good idea to add something like
>
>                 Assert(stream->distance == 1);
>                 Assert(stream->pending_read_nblocks == 0);
>                 Assert(stream->per_buffer_data_size == 0);
> +               Assert(per_buffer_data == NULL);
>
> in read_stream_next_buffer.  I doubt that this will shut Coverity
> up, but it would help to catch caller coding errors, i.e. passing
> a per_buffer_data pointer when there's no per-buffer data.

I think this is a good stopgap. I was discussing adding this assert
off-list with Thomas and he wanted to detail his more ambitious plans
for type safety improvements in the read stream API. Less on the order
of a redesign and more like a separate read_stream_next_buffer()s for
when there is per buffer data and when there isn't. And a by-value and
by-reference version for the one where there is data.

I'll plan to add this assert tomorrow if that discussion doesn't materialize.

- Melanie



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Log connection establishment timings
Next
From: Alexandra Wang
Date:
Subject: Re: SQL:2023 JSON simplified accessor support