Subject: Re: Should vacuum process config file reload more often

From: Masahiko Sawada <[email-masked]>
Date: Mon, 17 Apr 2023 11:04:22 +0900

On Wed, Apr 12, 2023 at 12:05 AM Masahiko Sawada <[email-masked]> wrote:
>
> On Fri, Apr 7, 2023 at 10:23 PM Daniel Gustafsson <[email-masked]> wrote:
> >
> > > On 7 Apr 2023, at 15:07, Melanie Plageman <[email-masked]> wrote:
> > > On Fri, Apr 7, 2023 at 2:53 AM Masahiko Sawada <[email-masked]> wrote:
> > >
> > > Definitely seems worth fixing as it kind of defeats the purpose of the
> > > original commit. I wish I had noticed before!
> > >
> > > Your fix has:
> > >            !(avopts && (avopts->vacuum_cost_limit >= 0 ||
> > >                        avopts->vacuum_cost_delay >= 0));
> > >
> > > And though delay is required to be >= 0
> > >                        avopts->vacuum_cost_delay >= 0
> > >
> > > Limit does not. It can just be > 0.
> > >
> > > postgres=# create table foo (a int) with (autovacuum_vacuum_cost_limit = 0);
> > > ERROR:  value 0 out of bounds for option "autovacuum_vacuum_cost_limit"
> > > DETAIL:  Valid values are between "1" and "10000".
> > >
> > > Though >= is also fine, the rest of the code in all versions always
> > > checks if limit > 0 and delay >= 0 since 0 is a valid value for delay
> > > and not for limit. Probably best we keep it consistent (though the whole
> > > thing is quite confusing).
> >
> > +1
>
> +1. I misunderstood the initial value of autovacuum_vacuum_cost_limit reloption.

I've attached an updated patch for fixing at_dobalance condition.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

---

From: Daniel Gustafsson <[email-masked]>
Date: Tue, 25 Apr 2023 14:39:39 +0200

> On 17 Apr 2023, at 04:04, Masahiko Sawada <[email-masked]> wrote:

> I've attached an updated patch for fixing at_dobalance condition.

I revisited this and pushed it to all supported branches after another round of
testing and reading.

--
Daniel Gustafsson

---

From: Masahiko Sawada <[email-masked]>
Date: Tue, 25 Apr 2023 22:31:11 +0900

> I revisited this and pushed it to all supported branches after another round of

Thanks!

Can we mark the open item "Can't disable autovacuum cost delay through
storage parameter" as resolved?

Regards,

---

From: Daniel Gustafsson <[email-masked]>
Date: Tue, 25 Apr 2023 15:35:45 +0200

> On 25 Apr 2023, at 15:31, Masahiko Sawada <[email-masked]> wrote:
> 

Yes, I've gone ahead and done that now.

--
Daniel Gustafsson

---

From: Masahiko Sawada <[email-masked]>
Date: Wed, 26 Apr 2023 00:02:25 +0900

> Yes, I've gone ahead and done that now.

Great, thank you!

Regards,