Skip to content

Commit ae35867

Browse files
committed
Remove undo information from pg_controldata --- never used.
Florian G. Pflug
1 parent 0763a56 commit ae35867

File tree

5 files changed

+11
-25
lines changed

5 files changed

+11
-25
lines changed

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.264 2007/02/14 05:00:40 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.265 2007/03/03 20:02:26 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -4039,7 +4039,6 @@ BootStrapXLOG(void)
40394039
/* Set up information for the initial checkpoint record */
40404040
checkPoint.redo.xlogid = 0;
40414041
checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
4042-
checkPoint.undo = checkPoint.redo;
40434042
checkPoint.ThisTimeLineID = ThisTimeLineID;
40444043
checkPoint.nextXidEpoch = 0;
40454044
checkPoint.nextXid = FirstNormalTransactionId;
@@ -4698,9 +4697,8 @@ StartupXLOG(void)
46984697
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
46994698

47004699
ereport(LOG,
4701-
(errmsg("redo record is at %X/%X; undo record is at %X/%X; shutdown %s",
4700+
(errmsg("redo record is at %X/%X; shutdown %s",
47024701
checkPoint.redo.xlogid, checkPoint.redo.xrecoff,
4703-
checkPoint.undo.xlogid, checkPoint.undo.xrecoff,
47044702
wasShutdown ? "TRUE" : "FALSE")));
47054703
ereport(LOG,
47064704
(errmsg("next transaction ID: %u/%u; next OID: %u",
@@ -4730,20 +4728,17 @@ StartupXLOG(void)
47304728
if (XLByteLT(RecPtr, checkPoint.redo))
47314729
ereport(PANIC,
47324730
(errmsg("invalid redo in checkpoint record")));
4733-
if (checkPoint.undo.xrecoff == 0)
4734-
checkPoint.undo = RecPtr;
47354731

47364732
/*
47374733
* Check whether we need to force recovery from WAL. If it appears to
47384734
* have been a clean shutdown and we did not have a recovery.conf file,
47394735
* then assume no recovery needed.
47404736
*/
4741-
if (XLByteLT(checkPoint.undo, RecPtr) ||
4742-
XLByteLT(checkPoint.redo, RecPtr))
4737+
if (XLByteLT(checkPoint.redo, RecPtr))
47434738
{
47444739
if (wasShutdown)
47454740
ereport(PANIC,
4746-
(errmsg("invalid redo/undo record in shutdown checkpoint")));
4741+
(errmsg("invalid redo record in shutdown checkpoint")));
47474742
InRecovery = true;
47484743
}
47494744
else if (ControlFile->state != DB_SHUTDOWNED)
@@ -5850,10 +5845,9 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
58505845
{
58515846
CheckPoint *checkpoint = (CheckPoint *) rec;
58525847

5853-
appendStringInfo(buf, "checkpoint: redo %X/%X; undo %X/%X; "
5848+
appendStringInfo(buf, "checkpoint: redo %X/%X; "
58545849
"tli %u; xid %u/%u; oid %u; multi %u; offset %u; %s",
58555850
checkpoint->redo.xlogid, checkpoint->redo.xrecoff,
5856-
checkpoint->undo.xlogid, checkpoint->undo.xrecoff,
58575851
checkpoint->ThisTimeLineID,
58585852
checkpoint->nextXidEpoch, checkpoint->nextXid,
58595853
checkpoint->nextOid,

src/bin/pg_controldata/pg_controldata.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
77
* licence: BSD
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.32 2006/12/08 19:50:53 tgl Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.33 2007/03/03 20:02:27 momjian Exp $
1010
*/
1111
#include "postgres.h"
1212

@@ -168,9 +168,6 @@ main(int argc, char *argv[])
168168
printf(_("Latest checkpoint's REDO location: %X/%X\n"),
169169
ControlFile.checkPointCopy.redo.xlogid,
170170
ControlFile.checkPointCopy.redo.xrecoff);
171-
printf(_("Latest checkpoint's UNDO location: %X/%X\n"),
172-
ControlFile.checkPointCopy.undo.xlogid,
173-
ControlFile.checkPointCopy.undo.xrecoff);
174171
printf(_("Latest checkpoint's TimeLineID: %u\n"),
175172
ControlFile.checkPointCopy.ThisTimeLineID);
176173
printf(_("Latest checkpoint's NextXID: %u/%u\n"),

src/bin/pg_resetxlog/pg_resetxlog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
26-
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.57 2007/02/10 14:58:55 petere Exp $
26+
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.58 2007/03/03 20:02:27 momjian Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -464,7 +464,6 @@ GuessControlValues(void)
464464

465465
ControlFile.checkPointCopy.redo.xlogid = 0;
466466
ControlFile.checkPointCopy.redo.xrecoff = SizeOfXLogLongPHD;
467-
ControlFile.checkPointCopy.undo = ControlFile.checkPointCopy.redo;
468467
ControlFile.checkPointCopy.ThisTimeLineID = 1;
469468
ControlFile.checkPointCopy.nextXidEpoch = 0;
470469
ControlFile.checkPointCopy.nextXid = (TransactionId) 514; /* XXX */
@@ -600,7 +599,6 @@ RewriteControlFile(void)
600599
ControlFile.checkPointCopy.redo.xlogid = newXlogId;
601600
ControlFile.checkPointCopy.redo.xrecoff =
602601
newXlogSeg * XLogSegSize + SizeOfXLogLongPHD;
603-
ControlFile.checkPointCopy.undo = ControlFile.checkPointCopy.redo;
604602
ControlFile.checkPointCopy.time = time(NULL);
605603

606604
ControlFile.state = DB_SHUTDOWNED;

src/include/access/xlog_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.18 2007/01/05 22:19:51 momjian Exp $
14+
* $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.19 2007/03/03 20:02:27 momjian Exp $
1515
*/
1616
#ifndef XLOG_INTERNAL_H
1717
#define XLOG_INTERNAL_H
@@ -71,7 +71,7 @@ typedef struct XLogContRecord
7171
/*
7272
* Each page of XLOG file has a header like this:
7373
*/
74-
#define XLOG_PAGE_MAGIC 0xD05E /* can be used as WAL version indicator */
74+
#define XLOG_PAGE_MAGIC 0xD05F /* can be used as WAL version indicator */
7575

7676
typedef struct XLogPageHeaderData
7777
{

src/include/catalog/pg_control.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.35 2007/01/05 22:19:52 momjian Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.36 2007/03/03 20:02:27 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -22,7 +22,7 @@
2222

2323

2424
/* Version identifier for this pg_control format */
25-
#define PG_CONTROL_VERSION 831
25+
#define PG_CONTROL_VERSION 832
2626

2727
/*
2828
* Body of CheckPoint XLOG records. This is declared here because we keep
@@ -32,9 +32,6 @@ typedef struct CheckPoint
3232
{
3333
XLogRecPtr redo; /* next RecPtr available when we began to
3434
* create CheckPoint (i.e. REDO start point) */
35-
XLogRecPtr undo; /* first record of oldest in-progress
36-
* transaction when we started (i.e. UNDO end
37-
* point) */
3835
TimeLineID ThisTimeLineID; /* current TLI */
3936
uint32 nextXidEpoch; /* higher-order bits of nextXid */
4037
TransactionId nextXid; /* next free XID */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy