pgsql: Restructure error handling in reading of postgresql.conf. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Restructure error handling in reading of postgresql.conf.
Date
Msg-id E1RASzb-00033F-5d@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Restructure error handling in reading of postgresql.conf.

This patch has two distinct purposes: to report multiple problems in
postgresql.conf rather than always bailing out after the first one,
and to change the policy for whether changes are applied when there are
unrelated errors in postgresql.conf.

Formerly the policy was to apply no changes if any errors could be
detected, but that had a significant consistency problem, because in some
cases specific values might be seen as valid by some processes but invalid
by others.  This meant that the latter processes would fail to adopt
changes in other parameters even though the former processes had done so.

The new policy is that during SIGHUP, the file is rejected as a whole
if there are any errors in the "name = value" syntax, or if any lines
attempt to set nonexistent built-in parameters, or if any lines attempt
to set custom parameters whose prefix is not listed in (the new value of)
custom_variable_classes.  These tests should always give the same results
in all processes, and provide what seems a reasonably robust defense
against loading values from badly corrupted config files.  If these tests
pass, all processes will apply all settings that they individually see as
good, ignoring (but logging) any they don't.

In addition, the postmaster does not abandon reading a configuration file
after the first syntax error, but continues to read the file and report
syntax errors (up to a maximum of 100 syntax errors per file).

The postmaster will still refuse to start up if the configuration file
contains any errors at startup time, but these changes allow multiple
errors to be detected and reported before quitting.

Alexey Klyukin, reviewed by Andy Colson and av (Alexander ?)
with some additional hacking by Tom Lane

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d56b3afc0376afe491065d9eca6440b3cc7b1346

Modified Files
--------------
doc/src/sgml/config.sgml          |    4 +-
src/backend/access/transam/xlog.c |    9 +-
src/backend/commands/extension.c  |    5 +-
src/backend/utils/misc/guc-file.l |  262 ++++++++++++++++++++++++-------------
src/backend/utils/misc/guc.c      |  196 +++++++++++++--------------
src/include/utils/guc.h           |    2 +-
6 files changed, 281 insertions(+), 197 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Improve generated column names for cases involving sub-SELECTs.
Next
From: itagaki@pgfoundry.org (User Itagaki)
Date:
Subject: textsearch-ja - textsearch-ja: Update pgut-be libraries.