]> granicus.if.org Git - postgresql/commitdiff
Fix documentation & config inconsistencies around 428b1d6b2.
authorAndres Freund <andres@anarazel.de>
Sun, 24 Apr 2016 19:26:55 +0000 (12:26 -0700)
committerAndres Freund <andres@anarazel.de>
Sun, 24 Apr 2016 19:26:55 +0000 (12:26 -0700)
Several issues:
1) checkpoint_flush_after doc and code disagreed about the default
2) new GUCs were missing from postgresql.conf.sample
3) Outdated source-code comment about bgwriter_flush_after's default
4) Sub-optimal categories assigned to new GUCs
5) Docs suggested backend_flush_after is PGC_SIGHUP, but it's PGC_USERSET.
6) Spell out int as integer in the docs, as done elsewhere

Reported-By: Magnus Hagander, Fujii Masao
Discussion: CAHGQGwETyTG5VYQQ5C_srwxWX7RXvFcD3dKROhvAWWhoSBdmZw@mail.gmail.com

doc/src/sgml/config.sgml
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample

index f9ba1487822e9f542961591ab2c0f466c8f8d239..909b3e23c522905efbd37e748433d349d616fae5 100644 (file)
@@ -1884,7 +1884,7 @@ include_dir 'conf.d'
       </varlistentry>
 
       <varlistentry id="guc-bgwriter-flush-after" xreflabel="bgwriter_flush_after">
-       <term><varname>bgwriter_flush_after</varname> (<type>int</type>)
+       <term><varname>bgwriter_flush_after</varname> (<type>integer</type>)
        <indexterm>
         <primary><varname>bgwriter_flush_after</> configuration parameter</primary>
        </indexterm>
@@ -2014,7 +2014,7 @@ include_dir 'conf.d'
       </varlistentry>
 
       <varlistentry id="guc-backend-flush-after" xreflabel="backend_flush_after">
-       <term><varname>backend_flush_after</varname> (<type>int</type>)
+       <term><varname>backend_flush_after</varname> (<type>integer</type>)
        <indexterm>
         <primary><varname>backend_flush_after</> configuration parameter</primary>
        </indexterm>
@@ -2036,8 +2036,6 @@ include_dir 'conf.d'
          and <literal>2MB</literal>.  The default is <literal>128Kb</> on
          Linux, <literal>0</> elsewhere.  (Non-default values of
          <symbol>BLCKSZ</symbol> change the default and maximum.)
-         This parameter can only be set in the <filename>postgresql.conf</>
-         file or on the server command line.
         </para>
        </listitem>
       </varlistentry>
@@ -2607,7 +2605,7 @@ include_dir 'conf.d'
      </varlistentry>
 
      <varlistentry id="guc-checkpoint-flush-after" xreflabel="checkpoint_flush_after">
-      <term><varname>checkpoint_flush_after</varname> (<type>int</type>)
+      <term><varname>checkpoint_flush_after</varname> (<type>integer</type>)
       <indexterm>
        <primary><varname>checkpoint_flush_after</> configuration parameter</primary>
       </indexterm>
@@ -2626,7 +2624,7 @@ include_dir 'conf.d'
         than the OS's page cache, where performance might degrade.  This
         setting may have no effect on some platforms.  The valid range is
         between <literal>0</literal>, which disables controlled writeback,
-        and <literal>2MB</literal>.  The default is <literal>128Kb</> on
+        and <literal>2MB</literal>.  The default is <literal>256Kb</> on
         Linux, <literal>0</> elsewhere.  (Non-default values of
         <symbol>BLCKSZ</symbol> change the default and maximum.)
         This parameter can only be set in the <filename>postgresql.conf</>
index fb091bc4a0bdde429fcc3662c4e4b658cac8bf1c..60856dda1984c119e0f123a8a14d147876bcc041 100644 (file)
@@ -2273,6 +2273,18 @@ static struct config_int ConfigureNamesInt[] =
                NULL, NULL, NULL
        },
 
+       {
+               {"checkpoint_flush_after", PGC_SIGHUP, WAL_CHECKPOINTS,
+                       gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
+                       NULL,
+                       GUC_UNIT_BLOCKS
+               },
+               &checkpoint_flush_after,
+               /* see bufmgr.h: OS dependent default */
+               DEFAULT_CHECKPOINT_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
+               NULL, NULL, NULL
+       },
+
        {
                {"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS,
                        gettext_noop("Sets the number of disk-page buffers in shared memory for WAL."),
@@ -2419,6 +2431,18 @@ static struct config_int ConfigureNamesInt[] =
                NULL, NULL, NULL
        },
 
+       {
+               {"bgwriter_flush_after", PGC_SIGHUP, RESOURCES_BGWRITER,
+                       gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
+                       NULL,
+                       GUC_UNIT_BLOCKS
+               },
+               &bgwriter_flush_after,
+               /* see bufmgr.h: OS dependent default */
+               DEFAULT_BGWRITER_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
+               NULL, NULL, NULL
+       },
+
        {
                {"effective_io_concurrency",
                        PGC_USERSET,
@@ -2436,19 +2460,7 @@ static struct config_int ConfigureNamesInt[] =
        },
 
        {
-               {"checkpoint_flush_after", PGC_SIGHUP, RESOURCES_ASYNCHRONOUS,
-                       gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
-                       NULL,
-                       GUC_UNIT_BLOCKS
-               },
-               &checkpoint_flush_after,
-               /* see bufmgr.h: OS dependent default */
-               DEFAULT_CHECKPOINT_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
-               NULL, NULL, NULL
-       },
-
-       {
-               {"backend_flush_after", PGC_USERSET, WAL_CHECKPOINTS,
+               {"backend_flush_after", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
                        gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
                        NULL,
                        GUC_UNIT_BLOCKS
@@ -2459,18 +2471,6 @@ static struct config_int ConfigureNamesInt[] =
                NULL, NULL, NULL
        },
 
-       {
-               {"bgwriter_flush_after", PGC_SIGHUP, WAL_CHECKPOINTS,
-                       gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
-                       NULL,
-                       GUC_UNIT_BLOCKS
-               },
-               &bgwriter_flush_after,
-               /* see bufmgr.h: 16 on Linux, 0 otherwise */
-               DEFAULT_BGWRITER_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
-               NULL, NULL, NULL
-       },
-
        {
                {"max_worker_processes",
                        PGC_POSTMASTER,
index d4dd285ef0a6b52333d630cf0cc5d010df8aa730..14b537ffb17dc012a84254eaacfa350e6e599cc9 100644 (file)
 #bgwriter_delay = 200ms                        # 10-10000ms between rounds
 #bgwriter_lru_maxpages = 100           # 0-1000 max buffers written/round
 #bgwriter_lru_multiplier = 2.0         # 0-10.0 multiplier on buffers scanned/round
+#bgwriter_flush_after = 0              # 0 disables,
+                                       # default is 512kb on linux, 0 otherwise
 
 # - Asynchronous Behavior -
 
 #max_parallel_degree = 0               # max number of worker processes per node
 #old_snapshot_threshold = -1           # 1min-60d; -1 disables; 0 is immediate
                                                                        # (change requires restart)
+#backend_flush_after = 0               # 0 disables,
+                                       # default is 128kb on linux, 0 otherwise
 
 
 #------------------------------------------------------------------------------
 #max_wal_size = 1GB
 #min_wal_size = 80MB
 #checkpoint_completion_target = 0.5    # checkpoint target duration, 0.0 - 1.0
+#checkpoint_flush_after = 0            # 0 disables,
+                                       # default is 256kb on linux, 0 otherwise
 #checkpoint_warning = 30s              # 0 disables
 
 # - Archiving -