Re: Config reload/restart preview

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Config reload/restart preview
Date: 2013-06-20 11:15:09
Message-ID: CABUevEzB5EPmKgpj3onwMyZ_piUQawEd+u5kywmKUqvxLExoxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 20, 2013 at 1:04 PM, Thom Brown <thom(at)linux(dot)com> wrote:
> Hi,
>
> I've noticed that there's no easy way of checking which settings will change
> if the config is reloaded, and I think not being able to do this can cause
> some unfortunate problems.
>
> For example, a customer went to change their configuration, just setting
> log_autovacuum_min_duration to about 20 seconds, and reloaded the server.
> However, the log file swelled to over 5GB in size before they realised
> something was wrong, and then reverted the change. It transpired that the
> reload also pulled in a log_statements change from 'ddl' to 'all' that
> someone must have changed at some point without applying it.
>
> Should we have a way of previewing changes that would be applied if we
> reloaded/restarted the server?
>
> For example:
>
> pg_ctl previewconfig
>
> SIGHUP: log_statements will change from 'ddl' to 'all'
> SIGHUP: log_vacuum_min_duration will change from -1 to 20000
> POSTMASTER: fsync will change from 'on' to 'off'
>
> I'm not proposing this specifically, but something that would provide such
> information.

Yes, we should.

This would go well with something I started working on some time ago
(but haven't actually gotten far on at all), which is the ability for
pg_ctl to be able to give feedback at all. Meaning a "pg_ctl reload"
should also be able to tell you which parameters were changed, without
having to go to the log. Obviously that's almost exactly the same
feature.

The problem today is that pg_ctl just sends off a SIGHUP when it does
a reload. We'd have to give it an actual interface that could return
data back as well, such as a socket of some kind. So it does take some
work to come up with. But I definitely think we should have something
like this.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2013-06-20 11:16:16 Re: Config reload/restart preview
Previous Message Markus Wanner 2013-06-20 11:14:32 Re: Change authentication error message (patch)