Document that archive_timeout will force new WAL files even if a single
authorBruce Momjian <bruce@momjian.us>
Fri, 5 Feb 2010 23:37:43 +0000 (23:37 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 5 Feb 2010 23:37:43 +0000 (23:37 +0000)
checkpoint has happened, and recommend adjusting checkpoint_timeout to
reduce the impact of this.

doc/src/sgml/config.sgml
src/backend/postmaster/bgwriter.c

index f208a7f159e5928c8aa396305c75076863cfffc6..b73d8cf01d6947f34de51be2222240d1887a6f2e 100644 (file)
@@ -1739,7 +1739,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"'  # Windows
         server to switch to a new WAL segment file periodically.  When this
         parameter is greater than zero, the server will switch to a new
         segment file whenever this many seconds have elapsed since the last
-        segment file switch.  Note that archived files that are closed early
+        segment file switch, and there has been any database activity,
+        including a single checkpoint.  (Increasing
+        <varname>checkpoint_timeout</> will reduce unnecessary
+        checkpoints on an idle system.)
+        Note that archived files that are closed early
         due to a forced switch are still the same length as completely full
         files.  Therefore, it is unwise to use a very short
         <varname>archive_timeout</> &mdash; it will bloat your archive
index 63046ee89cb4c7005e58721248fccb5f58cac4e3..0c44665e5067077f9ad1e04eba437e8e16c4c24c 100644 (file)
@@ -543,7 +543,10 @@ BackgroundWriterMain(void)
 
 /*
  * CheckArchiveTimeout -- check for archive_timeout and switch xlog files
- *     if needed
+ *
+ * This will switch to a new WAL file and force an archive file write
+ * if any activity is recorded in the current WAL file, including just
+ * a single checkpoint record.
  */
 static void
 CheckArchiveTimeout(void)