Commit ae35867a authored by Bruce Momjian's avatar Bruce Momjian

Remove undo information from pg_controldata --- never used.

Florian G. Pflug
parent 0763a565
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.264 2007/02/14 05:00:40 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.265 2007/03/03 20:02:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -4039,7 +4039,6 @@ BootStrapXLOG(void) ...@@ -4039,7 +4039,6 @@ BootStrapXLOG(void)
/* Set up information for the initial checkpoint record */ /* Set up information for the initial checkpoint record */
checkPoint.redo.xlogid = 0; checkPoint.redo.xlogid = 0;
checkPoint.redo.xrecoff = SizeOfXLogLongPHD; checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
checkPoint.undo = checkPoint.redo;
checkPoint.ThisTimeLineID = ThisTimeLineID; checkPoint.ThisTimeLineID = ThisTimeLineID;
checkPoint.nextXidEpoch = 0; checkPoint.nextXidEpoch = 0;
checkPoint.nextXid = FirstNormalTransactionId; checkPoint.nextXid = FirstNormalTransactionId;
...@@ -4698,9 +4697,8 @@ StartupXLOG(void) ...@@ -4698,9 +4697,8 @@ StartupXLOG(void)
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN); wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
ereport(LOG, ereport(LOG,
(errmsg("redo record is at %X/%X; undo record is at %X/%X; shutdown %s", (errmsg("redo record is at %X/%X; shutdown %s",
checkPoint.redo.xlogid, checkPoint.redo.xrecoff, checkPoint.redo.xlogid, checkPoint.redo.xrecoff,
checkPoint.undo.xlogid, checkPoint.undo.xrecoff,
wasShutdown ? "TRUE" : "FALSE"))); wasShutdown ? "TRUE" : "FALSE")));
ereport(LOG, ereport(LOG,
(errmsg("next transaction ID: %u/%u; next OID: %u", (errmsg("next transaction ID: %u/%u; next OID: %u",
...@@ -4730,20 +4728,17 @@ StartupXLOG(void) ...@@ -4730,20 +4728,17 @@ StartupXLOG(void)
if (XLByteLT(RecPtr, checkPoint.redo)) if (XLByteLT(RecPtr, checkPoint.redo))
ereport(PANIC, ereport(PANIC,
(errmsg("invalid redo in checkpoint record"))); (errmsg("invalid redo in checkpoint record")));
if (checkPoint.undo.xrecoff == 0)
checkPoint.undo = RecPtr;
/* /*
* Check whether we need to force recovery from WAL. If it appears to * Check whether we need to force recovery from WAL. If it appears to
* have been a clean shutdown and we did not have a recovery.conf file, * have been a clean shutdown and we did not have a recovery.conf file,
* then assume no recovery needed. * then assume no recovery needed.
*/ */
if (XLByteLT(checkPoint.undo, RecPtr) || if (XLByteLT(checkPoint.redo, RecPtr))
XLByteLT(checkPoint.redo, RecPtr))
{ {
if (wasShutdown) if (wasShutdown)
ereport(PANIC, ereport(PANIC,
(errmsg("invalid redo/undo record in shutdown checkpoint"))); (errmsg("invalid redo record in shutdown checkpoint")));
InRecovery = true; InRecovery = true;
} }
else if (ControlFile->state != DB_SHUTDOWNED) else if (ControlFile->state != DB_SHUTDOWNED)
...@@ -5850,10 +5845,9 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -5850,10 +5845,9 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
CheckPoint *checkpoint = (CheckPoint *) rec; CheckPoint *checkpoint = (CheckPoint *) rec;
appendStringInfo(buf, "checkpoint: redo %X/%X; undo %X/%X; " appendStringInfo(buf, "checkpoint: redo %X/%X; "
"tli %u; xid %u/%u; oid %u; multi %u; offset %u; %s", "tli %u; xid %u/%u; oid %u; multi %u; offset %u; %s",
checkpoint->redo.xlogid, checkpoint->redo.xrecoff, checkpoint->redo.xlogid, checkpoint->redo.xrecoff,
checkpoint->undo.xlogid, checkpoint->undo.xrecoff,
checkpoint->ThisTimeLineID, checkpoint->ThisTimeLineID,
checkpoint->nextXidEpoch, checkpoint->nextXid, checkpoint->nextXidEpoch, checkpoint->nextXid,
checkpoint->nextOid, checkpoint->nextOid,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001; * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD * licence: BSD
* *
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.32 2006/12/08 19:50:53 tgl Exp $ * $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.33 2007/03/03 20:02:27 momjian Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -168,9 +168,6 @@ main(int argc, char *argv[]) ...@@ -168,9 +168,6 @@ main(int argc, char *argv[])
printf(_("Latest checkpoint's REDO location: %X/%X\n"), printf(_("Latest checkpoint's REDO location: %X/%X\n"),
ControlFile.checkPointCopy.redo.xlogid, ControlFile.checkPointCopy.redo.xlogid,
ControlFile.checkPointCopy.redo.xrecoff); ControlFile.checkPointCopy.redo.xrecoff);
printf(_("Latest checkpoint's UNDO location: %X/%X\n"),
ControlFile.checkPointCopy.undo.xlogid,
ControlFile.checkPointCopy.undo.xrecoff);
printf(_("Latest checkpoint's TimeLineID: %u\n"), printf(_("Latest checkpoint's TimeLineID: %u\n"),
ControlFile.checkPointCopy.ThisTimeLineID); ControlFile.checkPointCopy.ThisTimeLineID);
printf(_("Latest checkpoint's NextXID: %u/%u\n"), printf(_("Latest checkpoint's NextXID: %u/%u\n"),
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.57 2007/02/10 14:58:55 petere Exp $ * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.58 2007/03/03 20:02:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -464,7 +464,6 @@ GuessControlValues(void) ...@@ -464,7 +464,6 @@ GuessControlValues(void)
ControlFile.checkPointCopy.redo.xlogid = 0; ControlFile.checkPointCopy.redo.xlogid = 0;
ControlFile.checkPointCopy.redo.xrecoff = SizeOfXLogLongPHD; ControlFile.checkPointCopy.redo.xrecoff = SizeOfXLogLongPHD;
ControlFile.checkPointCopy.undo = ControlFile.checkPointCopy.redo;
ControlFile.checkPointCopy.ThisTimeLineID = 1; ControlFile.checkPointCopy.ThisTimeLineID = 1;
ControlFile.checkPointCopy.nextXidEpoch = 0; ControlFile.checkPointCopy.nextXidEpoch = 0;
ControlFile.checkPointCopy.nextXid = (TransactionId) 514; /* XXX */ ControlFile.checkPointCopy.nextXid = (TransactionId) 514; /* XXX */
...@@ -600,7 +599,6 @@ RewriteControlFile(void) ...@@ -600,7 +599,6 @@ RewriteControlFile(void)
ControlFile.checkPointCopy.redo.xlogid = newXlogId; ControlFile.checkPointCopy.redo.xlogid = newXlogId;
ControlFile.checkPointCopy.redo.xrecoff = ControlFile.checkPointCopy.redo.xrecoff =
newXlogSeg * XLogSegSize + SizeOfXLogLongPHD; newXlogSeg * XLogSegSize + SizeOfXLogLongPHD;
ControlFile.checkPointCopy.undo = ControlFile.checkPointCopy.redo;
ControlFile.checkPointCopy.time = time(NULL); ControlFile.checkPointCopy.time = time(NULL);
ControlFile.state = DB_SHUTDOWNED; ControlFile.state = DB_SHUTDOWNED;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.18 2007/01/05 22:19:51 momjian Exp $ * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.19 2007/03/03 20:02:27 momjian Exp $
*/ */
#ifndef XLOG_INTERNAL_H #ifndef XLOG_INTERNAL_H
#define XLOG_INTERNAL_H #define XLOG_INTERNAL_H
...@@ -71,7 +71,7 @@ typedef struct XLogContRecord ...@@ -71,7 +71,7 @@ typedef struct XLogContRecord
/* /*
* Each page of XLOG file has a header like this: * Each page of XLOG file has a header like this:
*/ */
#define XLOG_PAGE_MAGIC 0xD05E /* can be used as WAL version indicator */ #define XLOG_PAGE_MAGIC 0xD05F /* can be used as WAL version indicator */
typedef struct XLogPageHeaderData typedef struct XLogPageHeaderData
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.35 2007/01/05 22:19:52 momjian Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.36 2007/03/03 20:02:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/* Version identifier for this pg_control format */ /* Version identifier for this pg_control format */
#define PG_CONTROL_VERSION 831 #define PG_CONTROL_VERSION 832
/* /*
* Body of CheckPoint XLOG records. This is declared here because we keep * Body of CheckPoint XLOG records. This is declared here because we keep
...@@ -32,9 +32,6 @@ typedef struct CheckPoint ...@@ -32,9 +32,6 @@ typedef struct CheckPoint
{ {
XLogRecPtr redo; /* next RecPtr available when we began to XLogRecPtr redo; /* next RecPtr available when we began to
* create CheckPoint (i.e. REDO start point) */ * create CheckPoint (i.e. REDO start point) */
XLogRecPtr undo; /* first record of oldest in-progress
* transaction when we started (i.e. UNDO end
* point) */
TimeLineID ThisTimeLineID; /* current TLI */ TimeLineID ThisTimeLineID; /* current TLI */
uint32 nextXidEpoch; /* higher-order bits of nextXid */ uint32 nextXidEpoch; /* higher-order bits of nextXid */
TransactionId nextXid; /* next free XID */ TransactionId nextXid; /* next free XID */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment