Re: Alter system and reload causes bogus complaints about setting changes - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: Alter system and reload causes bogus complaints about setting changes
Date
Msg-id CAA4eK1Jq1+fDV6jom9n2iU_T=LDe0MxrCU=jyUAM=j_Y4r+Htg@mail.gmail.com
Whole thread Raw
In response to Re: Alter system and reload causes bogus complaints about setting changes  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
Responses Re: Alter system and reload causes bogus complaints about setting changes  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
Re: Alter system and reload causes bogus complaints about setting changes  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
List pgsql-bugs
On Fri, Jul 4, 2014 at 3:59 AM, Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
wrote:
> On 04/07/14 04:57, Amit Kapila wrote:
>
>>> Hmmm - I didn't actually change the settings it is complaining
>>
>> about...and it is referring to the wrong file too. While this is hardly
>> serious, it is likely to be immensely confusing for folk who have not
been
>> actively following the new changes for 9.4 (ahem...that could be a lot of
>> people). It would be good to fix this before we end beta.
>>
>> This issue occurs mainly due to duplicate settings in postgresql.conf
>> and postgresql.auto.conf (file where ALTER SYSTEM writes).  I have
>> explained it in more detail in the below thread:
>>
>>
http://www.postgresql.org/message-id/CAA4eK1+mUTjc=GXJK3bYtSwV2BmBni=PHEvBqLQkhdUV9cWd1A@mail.gmail.com
>>
>>
>
> While you are correct about the cause (conflicting entries in
postgresql.conf and the auto conf) - the statement 'just eliminate them' is
not really acceptable. Why? because a completely default install via
'initdb' has settings uncommented in postgresql.conf, so anyone changing
the most likely-to-be changed settings (ahem - shared_buffers for instance)
will elicit this error when the change *something else* that only requires
a reload. I.e this is not a problem created by the user.

True, but as I explained in that thread as well that this is an
existing behaviour which is also visible via Alter System, so
changing an existing mechanism requires non-trivial fix (eliminating
duplicate entries during processing of config file) which I think
can be risky doing at this time in terms of impact, however we
can try to minimise the inconvenience user can face due to this feature.

> Also as I mentioned before, the error complains about the wrong file, so
the other statement 'the user can take appropriate action' is rather
disingenuous - how can they given the error is itself wrong?

Are you referring to ("postgresql.conf") in below messages? If yes, then
the file mentioned in error message is right, as the uncommented conflicting
value in postgresql.conf is the reason for this message.

> 2014-07-03 08:09:40 AST LOG:  parameter "max_connections" cannot be
changed without restarting the server
> 2014-07-03 08:09:40 AST LOG:  parameter "shared_buffers" cannot be
changed without restarting the server
..
> 2014-07-03 08:09:40 AST LOG:  configuration file
"/etc/postgresql/9.4/main/postgresql.conf" contains errors; unaffected
changes were applied

> I predict this is going to be a huge source of confusion for new users,
and at the very least the error message needs to be
> a) correct
>and b) actually tell the user the remedy.

As I suggested previously, we can explain the same in the
document as the above message can come in many ways, so
changing that is not appropriate.

I am thinking to add text somewhat like below in Alter System docs:
"It is advisable to comment values changed by via Alter System in
postgresql.conf else it can show spurious warnings during reload
for parameters that can only be applied when the server starts."


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Alter system and reload causes bogus complaints about setting changes
Next
From: 王学敏
Date:
Subject: Re: Alter system and reload causes bogus complaints about setting changes