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

2020-11-12 Thread Alexey Kondratov
On 2020-11-11 06:59, Tom Lane wrote: Alexey Kondratov writes: After looking on the autoprewarm code more closely I have realised that this 'double dump' issues was not an issues at all. I have just misplaced a debug elog(), so its second output in the log was only indicating that we calculated

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

2020-11-10 Thread Tom Lane
Alexey Kondratov writes: > After looking on the autoprewarm code more closely I have realised that > this 'double dump' issues was not an issues at all. I have just > misplaced a debug elog(), so its second output in the log was only > indicating that we calculated delay_in_ms one more time. A

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

2020-11-10 Thread Alexey Kondratov
On 2020-11-09 23:25, Tom Lane wrote: Alexey Kondratov writes: On 2020-11-09 21:53, Tom Lane wrote: 0002 seems like a pretty clear bug fix, though I wonder if this is exactly what we want to do going forward. It seems like a very large fraction of the callers of TimestampDifference would like

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

2020-11-09 Thread Tom Lane
Alexey Kondratov writes: > On 2020-11-09 21:53, Tom Lane wrote: >> 0002 seems like a pretty clear bug fix, though I wonder if this is exactly >> what we want to do going forward. It seems like a very large fraction of >> the callers of TimestampDifference would like to have the value in msec, >>

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

2020-11-09 Thread Alexey Kondratov
On 2020-11-09 21:53, Tom Lane wrote: Alexey Kondratov writes: After fixing this issue I have noticed that it still dumps blocks twice at each timeout (here I set autoprewarm_interval to 15s): ... This happens because at timeout time we were using continue, but actually we still have to wait th

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

2020-11-09 Thread Tom Lane
Alexey Kondratov writes: > After fixing this issue I have noticed that it still dumps blocks twice > at each timeout (here I set autoprewarm_interval to 15s): > ... > This happens because at timeout time we were using continue, but > actually we still have to wait the entire autoprewarm_interval

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

2020-11-09 Thread Jeevan Ladhe
Hi, On Mon, Nov 9, 2020 at 10:15 PM Alexey Kondratov 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 ma

Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm

2020-11-09 Thread Alexey Kondratov
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