1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Bring some clarity to the defaults for the xxx_flush_after parameters.

Instead of confusingly stating platform-dependent defaults for these
parameters in the comments in postgresql.conf.sample (with the main
entry being a lie on Linux), teach initdb to install the correct
platform-dependent value in postgresql.conf, similarly to the way
we handle other platform-dependent defaults.  This won't do anything
for existing 9.6 installations, but since it's effectively only a
documentation improvement, that seems OK.

Since this requires initdb to have access to the default values,
move the #define's for those to pg_config_manual.h; the original
placement in bufmgr.h is unworkable because that file can't be
included by frontend programs.

Adjust the default value for wal_writer_flush_after so that it is 1MB
regardless of XLOG_BLCKSZ, conforming to what is stated in both the
SGML docs and postgresql.conf.  (We could alternatively make it scale
with XLOG_BLCKSZ, but I'm not sure I see the point.)

Copy-edit related SGML documentation.

Fabien Coelho and Tom Lane, per a gripe from Tomas Vondra.

Discussion: <30ebc6e3-8358-09cf-44a8-578252938424@2ndquadrant.com>
This commit is contained in:
Tom Lane
2016-11-25 18:36:10 -05:00
parent ab77a5a456
commit dbdfd114f3
7 changed files with 66 additions and 41 deletions

View File

@ -2281,7 +2281,6 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_BLOCKS
},
&checkpoint_flush_after,
/* see bufmgr.h: OS dependent default */
DEFAULT_CHECKPOINT_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
NULL, NULL, NULL
},
@ -2310,12 +2309,12 @@ static struct config_int ConfigureNamesInt[] =
{
{"wal_writer_flush_after", PGC_SIGHUP, WAL_SETTINGS,
gettext_noop("Amount of WAL written out by WAL writer triggering a flush."),
gettext_noop("Amount of WAL written out by WAL writer that triggers a flush."),
NULL,
GUC_UNIT_XBLOCKS
},
&WalWriterFlushAfter,
128, 0, INT_MAX,
(1024*1024) / XLOG_BLCKSZ, 0, INT_MAX,
NULL, NULL, NULL
},
@ -2439,7 +2438,6 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_BLOCKS
},
&bgwriter_flush_after,
/* see bufmgr.h: OS dependent default */
DEFAULT_BGWRITER_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
NULL, NULL, NULL
},
@ -2467,7 +2465,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_BLOCKS
},
&backend_flush_after,
0, 0, WRITEBACK_MAX_PENDING_FLUSHES,
DEFAULT_BACKEND_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
NULL, NULL, NULL
},