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.
Showing
- doc/src/sgml/backup.sgml 2 additions, 3 deletionsdoc/src/sgml/backup.sgml
- doc/src/sgml/config.sgml 51 additions, 13 deletionsdoc/src/sgml/config.sgml
- doc/src/sgml/high-availability.sgml 4 additions, 4 deletionsdoc/src/sgml/high-availability.sgml
- doc/src/sgml/perform.sgml 22 additions, 23 deletionsdoc/src/sgml/perform.sgml
- src/backend/access/heap/rewriteheap.c 1 addition, 11 deletionssrc/backend/access/heap/rewriteheap.c
- src/backend/access/nbtree/nbtsort.c 1 addition, 14 deletionssrc/backend/access/nbtree/nbtsort.c
- src/backend/access/transam/xlog.c 148 additions, 62 deletionssrc/backend/access/transam/xlog.c
- src/backend/commands/cluster.c 1 addition, 18 deletionssrc/backend/commands/cluster.c
- src/backend/commands/copy.c 1 addition, 8 deletionssrc/backend/commands/copy.c
- src/backend/commands/tablecmds.c 1 addition, 26 deletionssrc/backend/commands/tablecmds.c
- src/backend/executor/execMain.c 1 addition, 8 deletionssrc/backend/executor/execMain.c
- src/backend/postmaster/postmaster.c 7 additions, 1 deletionsrc/backend/postmaster/postmaster.c
- src/backend/replication/walsender.c 19 additions, 1 deletionsrc/backend/replication/walsender.c
- src/backend/storage/ipc/standby.c 2 additions, 2 deletionssrc/backend/storage/ipc/standby.c
- src/backend/utils/misc/guc.c 12 additions, 2 deletionssrc/backend/utils/misc/guc.c
- src/backend/utils/misc/postgresql.conf.sample 1 addition, 0 deletionssrc/backend/utils/misc/postgresql.conf.sample
- src/bin/pg_controldata/pg_controldata.c 26 additions, 2 deletionssrc/bin/pg_controldata/pg_controldata.c
- src/bin/pg_resetxlog/pg_resetxlog.c 10 additions, 1 deletionsrc/bin/pg_resetxlog/pg_resetxlog.c
- src/include/access/xlog.h 14 additions, 13 deletionssrc/include/access/xlog.h
- src/include/access/xlog_internal.h 2 additions, 2 deletionssrc/include/access/xlog_internal.h
Loading
Please register or sign in to comment