Re: Should vacuum process config file reload more often

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, amit(dot)kapila16(at)gmail(dot)com
Subject: Re: Should vacuum process config file reload more often
Date: 2023-04-03 22:35:07
Message-ID: CAAKRu_ap7nhmqtKQ1TRo3LzHG3FK=YpGO=O0019M3BbN7ysm3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 3, 2023 at 3:08 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2023-04-03 14:43:14 -0400, Tom Lane wrote:
> > Melanie Plageman <melanieplageman(at)gmail(dot)com> writes:
> > > v13 attached with requested updates.
> >
> > I'm afraid I'd not been paying any attention to this discussion,
> > but better late than never. I'm okay with letting autovacuum
> > processes reload config files more often than now. However,
> > I object to allowing ProcessConfigFile to be called from within
> > commands in a normal user backend. The existing semantics are
> > that user backends respond to SIGHUP only at the start of processing
> > a user command, and I'm uncomfortable with suddenly deciding that
> > that can work differently if the command happens to be VACUUM.
> > It seems unprincipled and perhaps actively unsafe.
>
> I think it should be ok in commands like VACUUM that already internally start
> their own transactions, and thus require to be run outside of a transaction
> and at the toplevel. I share your concerns about allowing config reload in
> arbitrary places. While we might want to go there, it would require a lot more
> analysis.

As an alternative for your consideration, attached v14 set implements
the config file reload for autovacuum only (in 0003) and then enables it
for VACUUM and ANALYZE not in a nested transaction command (in 0004).

Previously I had the commits in the reverse order for ease of review (to
separate changes to worker limit balancing logic from config reload
code).

- Melanie

Attachment Content-Type Size
v14-0003-Autovacuum-refreshes-cost-based-delay-params-mor.patch text/x-patch 19.0 KB
v14-0004-VACUUM-reloads-config-file-more-often.patch text/x-patch 2.3 KB
v14-0002-Separate-vacuum-cost-variables-from-gucs.patch text/x-patch 10.4 KB
v14-0001-Make-vacuum-s-failsafe_active-a-global.patch text/x-patch 4.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Christensen 2023-04-03 22:55:30 Re: Kerberos delegation support in libpq and postgres_fdw
Previous Message Alexander Korotkov 2023-04-03 22:25:46 Re: POC: Lock updated tuples in tuple_update() and tuple_delete()