Re: Trying out read streams in pgvector (an extension) - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Trying out read streams in pgvector (an extension)
Date
Msg-id CAAKRu_aimYfrOJ1G=6sja=5n-9t7j8JHqX07HUJxfMJqo059jQ@mail.gmail.com
Whole thread
In response to Re: Trying out read streams in pgvector (an extension)  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
On Tue, Dec 9, 2025 at 4:42 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
>
> > 1.  read_stream_resume() as before, but with a new explicit
> > read_stream_pause(): if a block number callback would like to report a
> > temporary lack of information, it should return
> > read_stream_pause(stream), not InvalidBlockNumber.  Then after
> > read_stream_resume(stream) is called, the next
> > read_stream_next_buffer() enters the lookahead loop again.  While
> > paused, if the consumer drains all the existing buffers in the stream
> > and then one more, it will receive InvalidBuffer, but if the _resume()
> > call is made sooner, the consumer won't ever know about the temporary
> > lack of buffers in the stream.

I ended up committing read_stream_resume() in 38229cb905165fe but
without the tests because 1f6f200cab67e6, which added other read
stream tests, was imminent. I'd like to add the read_stream_resume()
test back now -- especially because we didn't end up adding another
user of read_stream_resume() in this release.

Attached 0001 is the test Thomas wrote ported over to be in the new
0004_read_stream.pl. It uses asserts instead of comparing output of
the SQL function to expected output, so I included a potential
alternative version of it in 0002 that uses that pattern. Note that
0002 is a diff from 0001, not an independent alternative patch. I
think the test needs more work either way, but I wanted to get the
ball rolling.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: bump minimum supported version of psql and pg_{dump,dumpall,upgrade} to v10
Next
From: Fujii Masao
Date:
Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?