Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm

From: Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>
To: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm
Date: 2020-11-09 18:05:52
Message-ID: CAOgcT0NWdwjDQv_AbKzYzU06--m6yAey8tQcZ-rwpeQxQzwRXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Nov 9, 2020 at 10:15 PM Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2020-11-09 18:06:44 Re: automatic analyze: readahead - add "IO read time" log message
Previous Message Tomas Vondra 2020-11-09 17:39:12 Re: WIP: BRIN multi-range indexes