Re: Using read_stream in index vacuum

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Using read_stream in index vacuum
Date: 2024-10-20 07:19:45
Message-ID: 5DDCBDE8-A024-4EDD-BDFD-4FC5244703F2@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 19 Oct 2024, at 20:41, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>
> I'm wondering why is the case, ISTM that we can do *p.current_blocknum
> = scanblkno*
> and *p.last_exclusive = num_pages* in each loop of the outer for?

Thanks for reviewing!
AFAIK we cannot restart stream if it's finished, so we have a race condition of main loop and callback caller.
Resolving this race condition would make code much more complex for a relatively small benefit.

I'll address typos in next patch version, thank you for looking into this.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-10-20 07:50:00 further #include cleanup (IWYU)
Previous Message Peter Eisentraut 2024-10-20 07:07:16 Fix C23 compiler warning