Re: Using read stream in autoprewarm

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Using read stream in autoprewarm
Дата
Msg-id F9ACE8D0-B807-4A17-B6BD-87EF0717983D@yesql.se
обсуждение исходный текст
Ответ на Re: Using read stream in autoprewarm  (Melanie Plageman <melanieplageman@gmail.com>)
Ответы Re: Using read stream in autoprewarm
Список pgsql-hackers
> On 3 Apr 2025, at 21:25, Melanie Plageman <melanieplageman@gmail.com> wrote:
>
> On Thu, Apr 3, 2025 at 11:17 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>>
>> I had a quick look at this. Looks good overall

Same here, this seemed like a good piece to bite into with my limited AIO
knowledge to learn more, and reading it over it seems like a good change.

A few small comments:

+    * `pos` is the read stream callback's index into block_info. Because the
I'm not a fan of markdown in code comments (also in a few more places).


+                       /* Time to try and open our new found relation */
s/new found/newfound/


+   while (p->pos < apw_state->prewarm_stop_idx)
+   {
+       BlockInfoRecord blk = p->block_info[p->pos];
+
+       CHECK_FOR_INTERRUPTS();
Isn't checking inside this loop increasing the frequency of checks compared to
the current version?


+           Assert(read_stream_next_buffer(stream, NULL) == InvalidBuffer);
Is there a non programmer-error case where this can happen?  The Assert right
after a loop around the same function seems to imply there is a race or toctou
case which if so could use a comment.

--
Daniel Gustafsson




В списке pgsql-hackers по дате отправления: