Hi,

On Wed, 18 Nov 2026 at 10:47, Bertrand Drouvot
<[email protected]> wrote:
>
> Hi,
>
> On Tue, Nov 17, 2026 at 04:54:08PM -0500, Melanie Plageman wrote:
> > On Tue, Nov 3, 2026 at 1:40 AM Bertrand Drouvot
> > <[email protected]> wrote:
> > >
> > > 0001 takes a different approach (than [2]) and recreates the ReadStream 
> > > when
> > > initscan() changes whether a strategy is active. Ordinary rescans 
> > > continue to
> > > reset and reuse the existing stream. It uses the existing ReadStream 
> > > APIs, which
> > > could also make the backpatches easier.
> >
> > Now that initscan() has to concern itself with the read stream because
> > it has to reset or end the stream before changing the strategy, then
> > change the strategy, and then make the new read stream, I think the
> > separation between initscan() and making the read stream is no longer
> > useful. In fact, the ping-ponging has become confusing. I think your
> > version might actually have read_stream_reset() getting called twice
> > in some cases since read_stream_end() also calls it. Attached v2 just
> > moves all the read stream setup into initscan() and adds some flags to
> > make it more clear when we want to rebuild the stream/strategy.
>
> Thanks for looking at it!
>
> Yeah, that makes sense to me. Having initscan() own the reset/end, strategy 
> update,
> and stream creation makes the ordering clearer (and also avoids the possible 
> double
> reset).

+1, v2 LGTM.


> "
> stream is allocated at the beginning of the scan and reset on rescan or
> when the scan direction changes.
> "
>
> worth to change it to something like?
>
> "
> The read stream is allocated at the beginning of the scan. It is reset when
> the scan direction changes. On rescan, it is reset if strategy use remains
> unchanged, and recreated otherwise.
> "

I think this is a nice improvement. This comment needs update after
this patch and I think what you recommended is correct and clear.

-- 
Regards,
Nazir Bilal Yavuz
Microsoft


Reply via email to