Thread: Include.d and warnings

Include.d and warnings

From
Andomar
Date:
We've set up an include directory in postgresql.conf:

     include_dir = 'conf.d'

The include directory has a file that changes the value of
"max_connections".

Now when we reload Postgres, an error appears in the logs:

-----
parameter ""max_connections"" cannot be changed without restarting the
server
...
configuration file ""/var/lib/pgsql/9.4/data/postgresql.conf"" contains
errors; unaffected changes were applied
-----

But max_connections did not change before the reload.  It is just
overruled in an included configuration file.

Is this behavior "by design", or should Postgres not give an error under
the above circumstances?

Kind Regards,
Andomar




Re: Include.d and warnings

From
Adrian Klaver
Date:
On 06/24/2015 02:01 AM, Andomar wrote:
> We've set up an include directory in postgresql.conf:
>
>      include_dir = 'conf.d'
>
> The include directory has a file that changes the value of
> "max_connections".
>
> Now when we reload Postgres, an error appears in the logs:
>
> -----
> parameter ""max_connections"" cannot be changed without restarting the
> server
> ...
> configuration file ""/var/lib/pgsql/9.4/data/postgresql.conf"" contains
> errors; unaffected changes were applied
> -----
>
> But max_connections did not change before the reload.  It is just
> overruled in an included configuration file.

But it is part of the reloaded file and gets read, otherwise what would
be the point of includes?

>
> Is this behavior "by design", or should Postgres not give an error under
> the above circumstances?

Well it is the same message you get if you change that value in a file
without an include. The docs say this is by design:

http://www.postgresql.org/docs/9.4/interactive/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE

"Some parameters can only be set at server start; any changes to their
entries in the configuration file will be ignored until the server is
restarted."

>
> Kind Regards,
> Andomar
>
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Include.d and warnings

From
Tom Lane
Date:
Andomar <andomar@aule.net> writes:
> We've set up an include directory in postgresql.conf:
>      include_dir = 'conf.d'

> The include directory has a file that changes the value of
> "max_connections".

> Now when we reload Postgres, an error appears in the logs:

> -----
> parameter ""max_connections"" cannot be changed without restarting the
> server
> ...
> configuration file ""/var/lib/pgsql/9.4/data/postgresql.conf"" contains
> errors; unaffected changes were applied
> -----

> But max_connections did not change before the reload.  It is just
> overruled in an included configuration file.

This is fixed in 9.4 and up.  Since it's just cosmetic, we did not
back-patch the change.

            regards, tom lane


Re: Include.d and warnings

From
Adrian Klaver
Date:
On 06/24/2015 07:43 AM, Tom Lane wrote:
> Andomar <andomar@aule.net> writes:
>> We've set up an include directory in postgresql.conf:
>>       include_dir = 'conf.d'
>
>> The include directory has a file that changes the value of
>> "max_connections".
>
>> Now when we reload Postgres, an error appears in the logs:
>
>> -----
>> parameter ""max_connections"" cannot be changed without restarting the
>> server
>> ...
>> configuration file ""/var/lib/pgsql/9.4/data/postgresql.conf"" contains
>> errors; unaffected changes were applied
>> -----
>
>> But max_connections did not change before the reload.  It is just
>> overruled in an included configuration file.
>
> This is fixed in 9.4 and up.  Since it's just cosmetic, we did not
> back-patch the change.

So is the below the cosmetic part?:

"
configuration file ""/var/lib/pgsql/9.4/data/postgresql.conf"" contains
errors; unaffected changes were applied
"
Just for my edification. If an include file contains a different value
for a setting that can only be changed on restart, Postgres is supposed
to throw out the restart message?

>
>             regards, tom lane
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Include.d and warnings

From
Andomar
Date:
>> But max_connections did not change before the reload.  It is just
>> overruled in an included configuration file.
>
> This is fixed in 9.4 and up.  Since it's just cosmetic, we did not
> back-patch the change.
>
We're running 9.4.4.  I've just tested this, and doing a "restart"
followed by a "reload" causes the error message to appear.

Is anyone else willing to try and reproduce the problem?

 > Just for my edification. If an include file contains a different
 > value for a setting that can only be changed on restart, Postgres is
 > supposed to throw out the restart message?

To clarify, the server is started with the setting already present:
postgresql.conf : max_connections 100
conf.d/extra.conf : max_connections 125

If you start the server and reload, this will give the error message.

Checking the live setting with "select * from pg_settings where name =
'max_connections'" shows that the setting already is 125.  So the
warning is confusing because a restart would not change anything.

Kind regards,
Andomar