Re: Re: File-per-GUC WAS: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: File-per-GUC WAS: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Date: 2013-08-05 17:58:22
Message-ID: 20130805175822.GG11189@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 5, 2013 at 10:52:52AM -0700, David Johnston wrote:
> Josh Berkus wrote
> > (this discussion concerns issue (D), file-per-setting vs. one-big-file)
> >
> > So the case of two sessions both modifying ALTER SYSTEM SET, and one
> > succeeding for some-but-all-GUCS, and the other succeeding for
> > some-but-not-all-GUCs, would not be user-friendly or pretty, even if
> > each setting change succeeded or failed atomically.
>
> Can the final file write occur only at "COMMIT;" with anything inside a
> transaction simply staged up for later saving (or rollback). The file write
> phase as a whole then needs to be atomic and not just a single GUC-file.

Yes, the writes would only happen at commit, but I see of no way to have
the renames happen atomically.

> Could the system read the last update timestamp of each GUC-file when the
> original statement is executed and then re-read all of them at commit and
> fail with some kind of serialization error if the last-update timestamp on
> any of the files has changed?

That sounds like a mess --- clearly a global lock and a single file for
all GUCs would be perferrable.

> I dislike the idea of any kind of automatic reload. That said some kind of
> "have their been any configuration changes since last reload?"
> query/function makes sense. In can be plugged into Nagios or similar to
> warn if these changes are occurring but made live.

Who talked about automatic reload? The bigger problem is new backends
starting and seeing partial state during the renames.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-08-05 18:02:42 Re: Unsafe GUCs and ALTER SYSTEM WAS: Re: ALTER SYSTEM SET
Previous Message Tom Lane 2013-08-05 17:56:40 Re: File-per-GUC WAS: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])