diff options
| author | Simon Riggs <simon@2ndQuadrant.com> | 2012-01-25 18:02:04 +0000 |
|---|---|---|
| committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-01-25 18:02:04 +0000 |
| commit | 8366c7803ec3d0591cf2d1226fea1fee947d56c3 (patch) | |
| tree | 6cdd97e2f9352127db470507f4e650fde0ad6f86 /src/bin/pg_resetxlog/pg_resetxlog.c | |
| parent | 74ab96a45ef6259aa6a86a781580edea8488511a (diff) | |
| download | postgresql-8366c7803ec3d0591cf2d1226fea1fee947d56c3.tar.gz | |
Allow pg_basebackup from standby node with safety checking.
Base backup follows recommended procedure, plus goes to great
lengths to ensure that partial page writes are avoided.
Jun Ishizuka and Fujii Masao, with minor modifications
Diffstat (limited to 'src/bin/pg_resetxlog/pg_resetxlog.c')
| -rw-r--r-- | src/bin/pg_resetxlog/pg_resetxlog.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index a14601ce7b..a3cd37e37f 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -489,6 +489,7 @@ GuessControlValues(void) ControlFile.checkPointCopy.redo.xlogid = 0; ControlFile.checkPointCopy.redo.xrecoff = SizeOfXLogLongPHD; ControlFile.checkPointCopy.ThisTimeLineID = 1; + ControlFile.checkPointCopy.fullPageWrites = false; ControlFile.checkPointCopy.nextXidEpoch = 0; ControlFile.checkPointCopy.nextXid = FirstNormalTransactionId; ControlFile.checkPointCopy.nextOid = FirstBootstrapObjectId; @@ -503,7 +504,7 @@ GuessControlValues(void) ControlFile.time = (pg_time_t) time(NULL); ControlFile.checkPoint = ControlFile.checkPointCopy.redo; - /* minRecoveryPoint and backupStartPoint can be left zero */ + /* minRecoveryPoint, backupStartPoint and backupEndPoint can be left zero */ ControlFile.wal_level = WAL_LEVEL_MINIMAL; ControlFile.MaxConnections = 100; @@ -569,6 +570,8 @@ PrintControlValues(bool guessed) sysident_str); printf(_("Latest checkpoint's TimeLineID: %u\n"), ControlFile.checkPointCopy.ThisTimeLineID); + printf(_("Latest checkpoint's full_page_writes: %s\n"), + ControlFile.checkPointCopy.fullPageWrites ? _("on") : _("off")); printf(_("Latest checkpoint's NextXID: %u/%u\n"), ControlFile.checkPointCopy.nextXidEpoch, ControlFile.checkPointCopy.nextXid); @@ -637,6 +640,8 @@ RewriteControlFile(void) ControlFile.minRecoveryPoint.xrecoff = 0; ControlFile.backupStartPoint.xlogid = 0; ControlFile.backupStartPoint.xrecoff = 0; + ControlFile.backupEndPoint.xlogid = 0; + ControlFile.backupEndPoint.xrecoff = 0; ControlFile.backupEndRequired = false; /* |
