Hi, On Thu, Aug 27, 2026 at 05:31:21PM +0300, Nazir Bilal Yavuz wrote: > I started reviewing the patches, but it will take some time. > Meanwhile, I think the initscan() strategy changes in 0001 and 0002 > fix an independent bug and could be committed separately. Melanie is > CCed since she may know more. Bug: > > heap_beginscan() creates a read stream using the current > scan->rs_strategy. On rescan, initscan() recalculates strategy > eligibility and may allocate or free the strategy if the relation > crosses the NBuffers / 4 threshold. However, the reused read stream > retains the original scan->rs_strategy. This can cause the stream to > either keep using no strategy after one is allocated or retain a > dangling pointer after one is freed.
FWIW I also observed the same issue while working on another thread [1]. I created a dedicated thread [2] for better visibility proposing a different approach than Yuhang's one. [1]: https://postgr.es/m/auCYYbDyrQEwIsQq%40bdtpg [2]: https://postgr.es/m/aumB7BHGWewR4x/S@bdtpg Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
