Re: [HACKERS] What is CheckPoint.undo needed for?

2007-03-03 Thread Bruce Momjian

Patch applied.  Thanks.

---


Florian G. Pflug wrote:
 Tom Lane wrote:
  Alvaro Herrera [EMAIL PROTECTED] writes:
  I think you should increase pg_control version.
  
  And the WAL page-header version, since this also changes WAL contents.
 
 Here is an updated version. I've incremeted XLOG_PAGE_MAGIC and
 PG_CONTROL_VERSION by one.
 
 greetings, Florian Pflug
 

 Index: src/backend/access/transam/xlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
 retrieving revision 1.264
 diff -a -u -r1.264 xlog.c
 --- src/backend/access/transam/xlog.c 14 Feb 2007 05:00:40 -  1.264
 +++ src/backend/access/transam/xlog.c 23 Feb 2007 15:09:09 -
 @@ -4039,7 +4039,6 @@
   /* Set up information for the initial checkpoint record */
   checkPoint.redo.xlogid = 0;
   checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
 - checkPoint.undo = checkPoint.redo;
   checkPoint.ThisTimeLineID = ThisTimeLineID;
   checkPoint.nextXidEpoch = 0;
   checkPoint.nextXid = FirstNormalTransactionId;
 @@ -4698,9 +4697,8 @@
   wasShutdown = (record-xl_info == XLOG_CHECKPOINT_SHUTDOWN);
  
   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.undo.xlogid, checkPoint.undo.xrecoff,
wasShutdown ? TRUE : FALSE)));
   ereport(LOG,
   (errmsg(next transaction ID: %u/%u; next OID: %u,
 @@ -4730,20 +4728,17 @@
   if (XLByteLT(RecPtr, checkPoint.redo))
   ereport(PANIC,
   (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
* have been a clean shutdown and we did not have a recovery.conf file,
* then assume no recovery needed.
*/
 - if (XLByteLT(checkPoint.undo, RecPtr) ||
 - XLByteLT(checkPoint.redo, RecPtr))
 + if (XLByteLT(checkPoint.redo, RecPtr))
   {
   if (wasShutdown)
   ereport(PANIC,
 - (errmsg(invalid redo/undo record in shutdown 
 checkpoint)));
 + (errmsg(invalid redo record in shutdown 
 checkpoint)));
   InRecovery = true;
   }
   else if (ControlFile-state != DB_SHUTDOWNED)
 @@ -5850,10 +5845,9 @@
   {
   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,
checkpoint-redo.xlogid, 
 checkpoint-redo.xrecoff,
 -  checkpoint-undo.xlogid, 
 checkpoint-undo.xrecoff,
checkpoint-ThisTimeLineID,
checkpoint-nextXidEpoch, 
 checkpoint-nextXid,
checkpoint-nextOid,
 Index: src/bin/pg_controldata/pg_controldata.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v
 retrieving revision 1.32
 diff -a -u -r1.32 pg_controldata.c
 --- src/bin/pg_controldata/pg_controldata.c   8 Dec 2006 19:50:53 -   
 1.32
 +++ src/bin/pg_controldata/pg_controldata.c   23 Feb 2007 15:09:09 -
 @@ -168,9 +168,6 @@
   printf(_(Latest checkpoint's REDO location:%X/%X\n),
  ControlFile.checkPointCopy.redo.xlogid,
  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),
  ControlFile.checkPointCopy.ThisTimeLineID);
   printf(_(Latest checkpoint's NextXID:  %u/%u\n),
 Index: src/bin/pg_resetxlog/pg_resetxlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v
 retrieving revision 1.57
 diff -a -u -r1.57 pg_resetxlog.c
 --- src/bin/pg_resetxlog/pg_resetxlog.c   10 Feb 2007 14:58:55 -  
 1.57
 +++ src/bin/pg_resetxlog/pg_resetxlog.c   23 Feb 2007 15:09:09 -
 @@ -464,7 +464,6 @@
  
   ControlFile.checkPointCopy.redo.xlogid = 0;
   ControlFile.checkPointCopy.redo.xrecoff = 

Re: [HACKERS] What is CheckPoint.undo needed for?

2007-03-03 Thread Bruce Momjian

Patch applied.  Thanks.

---


Florian G. Pflug wrote:
 Tom Lane wrote:
  Alvaro Herrera [EMAIL PROTECTED] writes:
  I think you should increase pg_control version.
  
  And the WAL page-header version, since this also changes WAL contents.
 
 Here is an updated version. I've incremeted XLOG_PAGE_MAGIC and
 PG_CONTROL_VERSION by one.
 
 greetings, Florian Pflug
 

 Index: src/backend/access/transam/xlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
 retrieving revision 1.264
 diff -a -u -r1.264 xlog.c
 --- src/backend/access/transam/xlog.c 14 Feb 2007 05:00:40 -  1.264
 +++ src/backend/access/transam/xlog.c 23 Feb 2007 15:09:09 -
 @@ -4039,7 +4039,6 @@
   /* Set up information for the initial checkpoint record */
   checkPoint.redo.xlogid = 0;
   checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
 - checkPoint.undo = checkPoint.redo;
   checkPoint.ThisTimeLineID = ThisTimeLineID;
   checkPoint.nextXidEpoch = 0;
   checkPoint.nextXid = FirstNormalTransactionId;
 @@ -4698,9 +4697,8 @@
   wasShutdown = (record-xl_info == XLOG_CHECKPOINT_SHUTDOWN);
  
   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.undo.xlogid, checkPoint.undo.xrecoff,
wasShutdown ? TRUE : FALSE)));
   ereport(LOG,
   (errmsg(next transaction ID: %u/%u; next OID: %u,
 @@ -4730,20 +4728,17 @@
   if (XLByteLT(RecPtr, checkPoint.redo))
   ereport(PANIC,
   (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
* have been a clean shutdown and we did not have a recovery.conf file,
* then assume no recovery needed.
*/
 - if (XLByteLT(checkPoint.undo, RecPtr) ||
 - XLByteLT(checkPoint.redo, RecPtr))
 + if (XLByteLT(checkPoint.redo, RecPtr))
   {
   if (wasShutdown)
   ereport(PANIC,
 - (errmsg(invalid redo/undo record in shutdown 
 checkpoint)));
 + (errmsg(invalid redo record in shutdown 
 checkpoint)));
   InRecovery = true;
   }
   else if (ControlFile-state != DB_SHUTDOWNED)
 @@ -5850,10 +5845,9 @@
   {
   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,
checkpoint-redo.xlogid, 
 checkpoint-redo.xrecoff,
 -  checkpoint-undo.xlogid, 
 checkpoint-undo.xrecoff,
checkpoint-ThisTimeLineID,
checkpoint-nextXidEpoch, 
 checkpoint-nextXid,
checkpoint-nextOid,
 Index: src/bin/pg_controldata/pg_controldata.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v
 retrieving revision 1.32
 diff -a -u -r1.32 pg_controldata.c
 --- src/bin/pg_controldata/pg_controldata.c   8 Dec 2006 19:50:53 -   
 1.32
 +++ src/bin/pg_controldata/pg_controldata.c   23 Feb 2007 15:09:09 -
 @@ -168,9 +168,6 @@
   printf(_(Latest checkpoint's REDO location:%X/%X\n),
  ControlFile.checkPointCopy.redo.xlogid,
  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),
  ControlFile.checkPointCopy.ThisTimeLineID);
   printf(_(Latest checkpoint's NextXID:  %u/%u\n),
 Index: src/bin/pg_resetxlog/pg_resetxlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v
 retrieving revision 1.57
 diff -a -u -r1.57 pg_resetxlog.c
 --- src/bin/pg_resetxlog/pg_resetxlog.c   10 Feb 2007 14:58:55 -  
 1.57
 +++ src/bin/pg_resetxlog/pg_resetxlog.c   23 Feb 2007 15:09:09 -
 @@ -464,7 +464,6 @@
  
   ControlFile.checkPointCopy.redo.xlogid = 0;
   ControlFile.checkPointCopy.redo.xrecoff = 

Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-28 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---


Florian G. Pflug wrote:
 Tom Lane wrote:
  Alvaro Herrera [EMAIL PROTECTED] writes:
  I think you should increase pg_control version.
  
  And the WAL page-header version, since this also changes WAL contents.
 
 Here is an updated version. I've incremeted XLOG_PAGE_MAGIC and
 PG_CONTROL_VERSION by one.
 
 greetings, Florian Pflug
 

 Index: src/backend/access/transam/xlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
 retrieving revision 1.264
 diff -a -u -r1.264 xlog.c
 --- src/backend/access/transam/xlog.c 14 Feb 2007 05:00:40 -  1.264
 +++ src/backend/access/transam/xlog.c 23 Feb 2007 15:09:09 -
 @@ -4039,7 +4039,6 @@
   /* Set up information for the initial checkpoint record */
   checkPoint.redo.xlogid = 0;
   checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
 - checkPoint.undo = checkPoint.redo;
   checkPoint.ThisTimeLineID = ThisTimeLineID;
   checkPoint.nextXidEpoch = 0;
   checkPoint.nextXid = FirstNormalTransactionId;
 @@ -4698,9 +4697,8 @@
   wasShutdown = (record-xl_info == XLOG_CHECKPOINT_SHUTDOWN);
  
   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.undo.xlogid, checkPoint.undo.xrecoff,
wasShutdown ? TRUE : FALSE)));
   ereport(LOG,
   (errmsg(next transaction ID: %u/%u; next OID: %u,
 @@ -4730,20 +4728,17 @@
   if (XLByteLT(RecPtr, checkPoint.redo))
   ereport(PANIC,
   (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
* have been a clean shutdown and we did not have a recovery.conf file,
* then assume no recovery needed.
*/
 - if (XLByteLT(checkPoint.undo, RecPtr) ||
 - XLByteLT(checkPoint.redo, RecPtr))
 + if (XLByteLT(checkPoint.redo, RecPtr))
   {
   if (wasShutdown)
   ereport(PANIC,
 - (errmsg(invalid redo/undo record in shutdown 
 checkpoint)));
 + (errmsg(invalid redo record in shutdown 
 checkpoint)));
   InRecovery = true;
   }
   else if (ControlFile-state != DB_SHUTDOWNED)
 @@ -5850,10 +5845,9 @@
   {
   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,
checkpoint-redo.xlogid, 
 checkpoint-redo.xrecoff,
 -  checkpoint-undo.xlogid, 
 checkpoint-undo.xrecoff,
checkpoint-ThisTimeLineID,
checkpoint-nextXidEpoch, 
 checkpoint-nextXid,
checkpoint-nextOid,
 Index: src/bin/pg_controldata/pg_controldata.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v
 retrieving revision 1.32
 diff -a -u -r1.32 pg_controldata.c
 --- src/bin/pg_controldata/pg_controldata.c   8 Dec 2006 19:50:53 -   
 1.32
 +++ src/bin/pg_controldata/pg_controldata.c   23 Feb 2007 15:09:09 -
 @@ -168,9 +168,6 @@
   printf(_(Latest checkpoint's REDO location:%X/%X\n),
  ControlFile.checkPointCopy.redo.xlogid,
  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),
  ControlFile.checkPointCopy.ThisTimeLineID);
   printf(_(Latest checkpoint's NextXID:  %u/%u\n),
 Index: src/bin/pg_resetxlog/pg_resetxlog.c
 ===
 RCS file: /projects/cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v
 retrieving revision 1.57
 diff -a -u -r1.57 pg_resetxlog.c
 --- src/bin/pg_resetxlog/pg_resetxlog.c   10 Feb 2007 14:58:55 -  
 1.57
 +++ 

Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-23 Thread Florian G. Pflug

Tom Lane wrote:

Alvaro Herrera [EMAIL PROTECTED] writes:

I think you should increase pg_control version.


And the WAL page-header version, since this also changes WAL contents.


Here is an updated version. I've incremeted XLOG_PAGE_MAGIC and
PG_CONTROL_VERSION by one.

greetings, Florian Pflug

Index: src/backend/access/transam/xlog.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.264
diff -a -u -r1.264 xlog.c
--- src/backend/access/transam/xlog.c   14 Feb 2007 05:00:40 -  1.264
+++ src/backend/access/transam/xlog.c   23 Feb 2007 15:09:09 -
@@ -4039,7 +4039,6 @@
/* Set up information for the initial checkpoint record */
checkPoint.redo.xlogid = 0;
checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
-   checkPoint.undo = checkPoint.redo;
checkPoint.ThisTimeLineID = ThisTimeLineID;
checkPoint.nextXidEpoch = 0;
checkPoint.nextXid = FirstNormalTransactionId;
@@ -4698,9 +4697,8 @@
wasShutdown = (record-xl_info == XLOG_CHECKPOINT_SHUTDOWN);
 
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.undo.xlogid, checkPoint.undo.xrecoff,
 wasShutdown ? TRUE : FALSE)));
ereport(LOG,
(errmsg(next transaction ID: %u/%u; next OID: %u,
@@ -4730,20 +4728,17 @@
if (XLByteLT(RecPtr, checkPoint.redo))
ereport(PANIC,
(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
 * have been a clean shutdown and we did not have a recovery.conf file,
 * then assume no recovery needed.
 */
-   if (XLByteLT(checkPoint.undo, RecPtr) ||
-   XLByteLT(checkPoint.redo, RecPtr))
+   if (XLByteLT(checkPoint.redo, RecPtr))
{
if (wasShutdown)
ereport(PANIC,
-   (errmsg(invalid redo/undo record in shutdown 
checkpoint)));
+   (errmsg(invalid redo record in shutdown 
checkpoint)));
InRecovery = true;
}
else if (ControlFile-state != DB_SHUTDOWNED)
@@ -5850,10 +5845,9 @@
{
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,
 checkpoint-redo.xlogid, 
checkpoint-redo.xrecoff,
-checkpoint-undo.xlogid, 
checkpoint-undo.xrecoff,
 checkpoint-ThisTimeLineID,
 checkpoint-nextXidEpoch, 
checkpoint-nextXid,
 checkpoint-nextOid,
Index: src/bin/pg_controldata/pg_controldata.c
===
RCS file: /projects/cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v
retrieving revision 1.32
diff -a -u -r1.32 pg_controldata.c
--- src/bin/pg_controldata/pg_controldata.c 8 Dec 2006 19:50:53 -   
1.32
+++ src/bin/pg_controldata/pg_controldata.c 23 Feb 2007 15:09:09 -
@@ -168,9 +168,6 @@
printf(_(Latest checkpoint's REDO location:%X/%X\n),
   ControlFile.checkPointCopy.redo.xlogid,
   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),
   ControlFile.checkPointCopy.ThisTimeLineID);
printf(_(Latest checkpoint's NextXID:  %u/%u\n),
Index: src/bin/pg_resetxlog/pg_resetxlog.c
===
RCS file: /projects/cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v
retrieving revision 1.57
diff -a -u -r1.57 pg_resetxlog.c
--- src/bin/pg_resetxlog/pg_resetxlog.c 10 Feb 2007 14:58:55 -  1.57
+++ src/bin/pg_resetxlog/pg_resetxlog.c 23 Feb 2007 15:09:09 -
@@ -464,7 +464,6 @@
 
ControlFile.checkPointCopy.redo.xlogid = 0;
ControlFile.checkPointCopy.redo.xrecoff = SizeOfXLogLongPHD;
-   ControlFile.checkPointCopy.undo = ControlFile.checkPointCopy.redo;

Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Teodor Sigaev



What am I missing?

Seems, it's about that
http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php

--
Teodor Sigaev   E-mail: [EMAIL PROTECTED]
   WWW: http://www.sigaev.ru/

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Teodor Sigaev

Opps, sorry, I missed checkpoint keyword

Teodor Sigaev wrote:



What am I missing?

Seems, it's about that
http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php



--
Teodor Sigaev   E-mail: [EMAIL PROTECTED]
   WWW: http://www.sigaev.ru/

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Heikki Linnakangas
No you're right, it's related to the WAL undo stuff that was never 
actually implemented. It's dead code.


Teodor Sigaev wrote:

Opps, sorry, I missed checkpoint keyword

Teodor Sigaev wrote:



What am I missing?

Seems, it's about that
http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php






--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Florian G. Pflug

Heikki Linnakangas wrote:
No you're right, it's related to the WAL undo stuff that was never 
actually implemented. It's dead code.


Teodor Sigaev wrote:

Opps, sorry, I missed checkpoint keyword

Teodor Sigaev wrote:



What am I missing?

Seems, it's about that
http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php


Thanks - everything makes much more sense now ;-)

greetings, Florian Pflug

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Alvaro Herrera
Florian G. Pflug wrote:
 Heikki Linnakangas wrote:
 No you're right, it's related to the WAL undo stuff that was never 
 actually implemented. It's dead code.
 
 Teodor Sigaev wrote:
 Opps, sorry, I missed checkpoint keyword
 
 Teodor Sigaev wrote:
 
 What am I missing?
 Seems, it's about that
 http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php
 
 Thanks - everything makes much more sense now ;-)

So if you want to submit a patch to remove it, it'll make sense for
future readers as well ;-)

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Florian G. Pflug

Alvaro Herrera wrote:

Florian G. Pflug wrote:

Heikki Linnakangas wrote:
No you're right, it's related to the WAL undo stuff that was never 
actually implemented. It's dead code.


Teodor Sigaev wrote:

Opps, sorry, I missed checkpoint keyword

Teodor Sigaev wrote:

What am I missing?

Seems, it's about that
http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php

Thanks - everything makes much more sense now ;-)


So if you want to submit a patch to remove it, it'll make sense for
future readers as well ;-)


Here you go. I'm not subscribe to pgsql-patches, so I posted this here.

greetings, Florian Pflug


Index: src/backend/access/transam/xlog.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.264
diff -a -u -r1.264 xlog.c
--- src/backend/access/transam/xlog.c   14 Feb 2007 05:00:40 -  1.264
+++ src/backend/access/transam/xlog.c   22 Feb 2007 15:47:52 -
@@ -4039,7 +4039,6 @@
/* Set up information for the initial checkpoint record */
checkPoint.redo.xlogid = 0;
checkPoint.redo.xrecoff = SizeOfXLogLongPHD;
-   checkPoint.undo = checkPoint.redo;
checkPoint.ThisTimeLineID = ThisTimeLineID;
checkPoint.nextXidEpoch = 0;
checkPoint.nextXid = FirstNormalTransactionId;
@@ -4698,9 +4697,8 @@
wasShutdown = (record-xl_info == XLOG_CHECKPOINT_SHUTDOWN);
 
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.undo.xlogid, checkPoint.undo.xrecoff,
 wasShutdown ? TRUE : FALSE)));
ereport(LOG,
(errmsg(next transaction ID: %u/%u; next OID: %u,
@@ -4730,20 +4728,17 @@
if (XLByteLT(RecPtr, checkPoint.redo))
ereport(PANIC,
(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
 * have been a clean shutdown and we did not have a recovery.conf file,
 * then assume no recovery needed.
 */
-   if (XLByteLT(checkPoint.undo, RecPtr) ||
-   XLByteLT(checkPoint.redo, RecPtr))
+   if (XLByteLT(checkPoint.redo, RecPtr))
{
if (wasShutdown)
ereport(PANIC,
-   (errmsg(invalid redo/undo record in shutdown 
checkpoint)));
+   (errmsg(invalid redo record in shutdown 
checkpoint)));
InRecovery = true;
}
else if (ControlFile-state != DB_SHUTDOWNED)
@@ -5850,10 +5845,9 @@
{
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,
 checkpoint-redo.xlogid, 
checkpoint-redo.xrecoff,
-checkpoint-undo.xlogid, 
checkpoint-undo.xrecoff,
 checkpoint-ThisTimeLineID,
 checkpoint-nextXidEpoch, 
checkpoint-nextXid,
 checkpoint-nextOid,
Index: src/bin/pg_controldata/pg_controldata.c
===
RCS file: /projects/cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v
retrieving revision 1.32
diff -a -u -r1.32 pg_controldata.c
--- src/bin/pg_controldata/pg_controldata.c 8 Dec 2006 19:50:53 -   
1.32
+++ src/bin/pg_controldata/pg_controldata.c 22 Feb 2007 15:47:52 -
@@ -168,9 +168,6 @@
printf(_(Latest checkpoint's REDO location:%X/%X\n),
   ControlFile.checkPointCopy.redo.xlogid,
   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),
   ControlFile.checkPointCopy.ThisTimeLineID);
printf(_(Latest checkpoint's NextXID:  %u/%u\n),
Index: src/include/catalog/pg_control.h
===
RCS file: /projects/cvsroot/pgsql/src/include/catalog/pg_control.h,v
retrieving revision 1.35
diff -a -u -r1.35 pg_control.h
--- src/include/catalog/pg_control.h5 Jan 2007 22:19:52 -   1.35

Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Alvaro Herrera
Florian G. Pflug wrote:
 Alvaro Herrera wrote:
 Florian G. Pflug wrote:
 Heikki Linnakangas wrote:
 No you're right, it's related to the WAL undo stuff that was never 
 actually implemented. It's dead code.
 
 Teodor Sigaev wrote:
 Opps, sorry, I missed checkpoint keyword
 
 Teodor Sigaev wrote:
 What am I missing?
 Seems, it's about that
 http://archives.postgresql.org/pgsql-committers/2005-06/msg00085.php
 Thanks - everything makes much more sense now ;-)
 
 So if you want to submit a patch to remove it, it'll make sense for
 future readers as well ;-)
 
 Here you go. I'm not subscribe to pgsql-patches, so I posted this here.

I think you should increase pg_control version.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] What is CheckPoint.undo needed for?

2007-02-22 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes:
 I think you should increase pg_control version.

And the WAL page-header version, since this also changes WAL contents.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly