From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | Melanie Plageman <melanieplageman(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tomas Vondra <tomas(at)vondra(dot)me>, Noah Misch <noah(at)leadboat(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru> |
Subject: | Re: Confine vacuum skip logic to lazy_scan_skip |
Date: | 2025-02-28 01:29:16 |
Message-ID: | CA+hUKG+SWMtu9D1eevnbdzf=vurfuDjdFVM5WnX28Fxp-H3mYg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Feb 28, 2025 at 11:58 AM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
> On Thu, Feb 27, 2025 at 1:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.
Here's what I had in mind. Is it better?
Attachment | Content-Type | Size |
---|---|---|
0001-Improve-API-for-retrieving-data-from-read-streams.patch | text/x-patch | 10.1 KB |
0002-Improve-API-for-storing-data-in-read-streams.patch | text/x-patch | 2.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Zhang Mingli | 2025-02-28 01:32:49 | Re: Improve documentation regarding custom settings, placeholders, and the administrative functions |
Previous Message | Michael Paquier | 2025-02-28 01:18:53 | Re: Small memory fixes for pg_createsubcriber |