Re: Using read_stream in index vacuum - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: Using read_stream in index vacuum
Date
Msg-id 31207CAC-A94B-44EC-962C-4E12AE23C974@yandex-team.ru
Whole thread Raw
In response to Re: Using read_stream in index vacuum  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: Using read_stream in index vacuum
List pgsql-hackers

> On 22 Oct 2024, at 00:05, Melanie Plageman <melanieplageman@gmail.com> wrote:
>
> I was suggesting you call RelationGetNumberOfBlocks() once
> current_block == last_exclusive in the callback itself.

Consider following sequence of events:

0. We schedule some buffers for IO
1. We call RelationGetNumberOfBlocks() in callback when current_block == last_exclusive and return InvalidBlockNumber
tosignal EOF 
After this:
2. Some page is getting split into new page with number last_exclusive
3. Buffers from IO are returned and vacuumed, but not with number last_exclusive, because it was not scheduled

Maybe I'm missing something...


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Row pattern recognition
Next
From: Peter Eisentraut
Date:
Subject: Re: Fix C23 compiler warning