summaryrefslogtreecommitdiff
path: root/src/bin/pg_resetxlog/pg_resetxlog.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-04-28 16:10:43 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-04-28 16:10:43 +0000
commit9b8a73326e99821caf33c36c081cb307e17422d4 (patch)
tree6ba969ff6d18829c87fde36b9608f4d051cc7b8c /src/bin/pg_resetxlog/pg_resetxlog.c
parenta2de4826e912057a9a3c44e6c4c204dfa3b753a9 (diff)
downloadpostgresql-9b8a73326e99821caf33c36c081cb307e17422d4.tar.gz
Introduce wal_level GUC to explicitly control if information needed for
archival or hot standby should be WAL-logged, instead of deducing that from other options like archive_mode. This replaces recovery_connections GUC in the primary, where it now has no effect, but it's still used in the standby to enable/disable hot standby. Remove the WAL-logging of "unlogged operations", like creating an index without WAL-logging and fsyncing it at the end. Instead, we keep a copy of the wal_mode setting and the settings that affect how much shared memory a hot standby server needs to track master transactions (max_connections, max_prepared_xacts, max_locks_per_xact) in pg_control. Whenever the settings change, at server restart, write a WAL record noting the new settings and update pg_control. This allows us to notice the change in those settings in the standby at the right moment, they used to be included in checkpoint records, but that meant that a changed value was not reflected in the standby until the first checkpoint after the change. Bump PG_CONTROL_VERSION and XLOG_PAGE_MAGIC. Whack XLOG_PAGE_MAGIC back to the sequence it used to follow, before hot standby and subsequent patches changed it to 0x9003.
Diffstat (limited to 'src/bin/pg_resetxlog/pg_resetxlog.c')
-rw-r--r--src/bin/pg_resetxlog/pg_resetxlog.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index d14df9cec8..a8a43c44f0 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.78 2010/02/26 02:01:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.79 2010/04/28 16:10:43 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -628,6 +628,15 @@ RewriteControlFile(void)
ControlFile.backupStartPoint.xlogid = 0;
ControlFile.backupStartPoint.xrecoff = 0;
+ /*
+ * Use the defaults for max_* settings. The values don't matter
+ * as long as wal_level='minimal'.
+ */
+ ControlFile.MaxConnections = 100;
+ ControlFile.max_prepared_xacts = 0;
+ ControlFile.max_locks_per_xact = 64;
+ ControlFile.wal_level = WAL_LEVEL_MINIMAL;
+
/* Now we can force the recorded xlog seg size to the right thing. */
ControlFile.xlog_seg_size = XLogSegSize;