Re: Using read stream in autoprewarm

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, Matheus Alcantara <mths(dot)dev(at)pm(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Using read stream in autoprewarm
Date: 2025-04-01 12:50:32
Message-ID: CAN55FZ11Qrn2=2DvpmqSX2OHP3m1YUC1NoAPS=kRu6my9kjO2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, 1 Apr 2025 at 05:14, Melanie Plageman <melanieplageman(at)gmail(dot)com> wrote:
>
> On Mon, Mar 31, 2025 at 3:45 PM Melanie Plageman
> <melanieplageman(at)gmail(dot)com> wrote:
> >
> > Whoops, this isn't right. It does work. I'm going to draft a version
> > suggesting slightly different variable naming and a couple comments to
> > make this more clear.
>
> Okay, so after further study, I think there are multiple issues still
> with the code. We could end up comparing a blocknumber to nblocks
> calculated from a different fork. To address this, you'll need to keep
> track of the last fork_number. At that point, you kind of have to
> bring back old_blk -- because that is what we are recreating with
> multiple local variables.

I am attaching v8, which is an updated version of the v7. I tried to
get rid of these local variables and refactored code to make logic
more straightforward instead of going back and forth.

0001 and 0002 are v8. 0003 is another refactoring attempt to make code
more straightforward. I did not squash 0003 to previous patches as you
might not like it.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v8-0001-Optimize-autoprewarm-with-read-streams.patch application/octet-stream 7.5 KB
v8-0002-Count-free-buffers-at-the-start-of-the-autoprewar.patch application/octet-stream 3.0 KB
v8-0003-Refactor-code-more.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-04-01 12:50:55 Re: Index AM API cleanup
Previous Message vignesh C 2025-04-01 12:47:32 Re: [PATCH] Fix build on MINGW on ARM64