Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
Date
Msg-id CA+hUKGL5Nnr7gp_APfqPQX9ow5OzArXFbpPD1ch0=nrXzBt07g@mail.gmail.com
Whole thread Raw
In response to Sub-millisecond [autovacuum_]vacuum_cost_delay broken  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
List pgsql-hackers
On Fri, Mar 10, 2023 at 10:26 AM Melanie Plageman
<melanieplageman@gmail.com> wrote:
> I think that 4753ef37e0ed undid the work caf626b2c did to support
> sub-millisecond delays for vacuum and autovacuum.
>
> After 4753ef37e0ed, vacuum_delay_point()'s local variable msec is a
> double which, after being passed to WaitLatch() as timeout, which is a
> long, ends up being 0, so we don't end up waiting AFAICT.
>
> When I set [autovacuum_]vacuum_delay_point to 0.5, SHOW will report that
> it is 500us, but WaitLatch() is still getting 0 as timeout.

Given that some of the clunkier underlying kernel primitives have
milliseconds in their interface, I don't think it would be possible to
make a usec-based variant of WaitEventSetWait() that works everywhere.
Could it possibly make sense to do something that accumulates the
error, so if you're using 0.5 then every second vacuum_delay_point()
waits for 1ms?



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
Next
From: Tom Lane
Date:
Subject: Re: Date-time extraneous fields with reserved keywords