Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm - Mailing list pgsql-hackers

From Jeevan Ladhe
Subject Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm
Date
Msg-id CAOgcT0NWdwjDQv_AbKzYzU06--m6yAey8tQcZ-rwpeQxQzwRXg@mail.gmail.com
Whole thread Raw
In response to Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm  (Alexey Kondratov <a.kondratov@postgrespro.ru>)
List pgsql-hackers
Hi,

On Mon, Nov 9, 2020 at 10:15 PM Alexey Kondratov <a.kondratov@postgrespro.ru> wrote:
Hi Hackers,

Today I have accidentally noticed that autoprewarm feature of pg_prewarm
used TimestampDifference()'s results in a wrong way.

First, it used *seconds* result from it as a *milliseconds*. It was
causing it to make dump file autoprewarm.blocks ~every second with
default setting of autoprewarm_interval = 300s.


I had a look at this, and I agree that this is an issue. I also had a look at
the patch 0002, and the patch looks good to me.

In patch 0003 there is a typo:

+ /* We have to sleep even after a successfull dump */

s/successfull/successful


Regards,
Jeevan Ladhe

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: WIP: BRIN multi-range indexes
Next
From: Stephen Frost
Date:
Subject: Re: automatic analyze: readahead - add "IO read time" log message