Commit 21992dd4 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix handling of b-tree reuse WAL records when hot standby is disabled,

and add missing code in btree_desc for them. This fixes the bug
with "tree_redo: unknown op code 208" error reported by Jaime Casanova.
parent f9d9b2b3
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.67 2010/04/22 08:04:24 sriggs Exp $ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.68 2010/04/30 06:34:29 heikki Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -954,7 +954,6 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -954,7 +954,6 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
switch (info) switch (info)
{ {
case XLOG_BTREE_DELETE: case XLOG_BTREE_DELETE:
/* /*
* Btree delete records can conflict with standby queries. You * Btree delete records can conflict with standby queries. You
* might think that vacuum records would conflict as well, but * might think that vacuum records would conflict as well, but
...@@ -973,7 +972,6 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -973,7 +972,6 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
break; break;
case XLOG_BTREE_REUSE_PAGE: case XLOG_BTREE_REUSE_PAGE:
/* /*
* Btree reuse page records exist to provide a conflict point * Btree reuse page records exist to provide a conflict point
* when we reuse pages in the index via the FSM. That's all it * when we reuse pages in the index via the FSM. That's all it
...@@ -1034,6 +1032,9 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record) ...@@ -1034,6 +1032,9 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
case XLOG_BTREE_NEWROOT: case XLOG_BTREE_NEWROOT:
btree_xlog_newroot(lsn, record); btree_xlog_newroot(lsn, record);
break; break;
case XLOG_BTREE_REUSE_PAGE:
/* Handled above before restoring bkp block */
break;
default: default:
elog(PANIC, "btree_redo: unknown op code %u", info); elog(PANIC, "btree_redo: unknown op code %u", info);
} }
...@@ -1169,6 +1170,15 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -1169,6 +1170,15 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
xlrec->rootblk, xlrec->level); xlrec->rootblk, xlrec->level);
break; break;
} }
case XLOG_BTREE_REUSE_PAGE:
{
xl_btree_reuse_page *xlrec = (xl_btree_reuse_page *) rec;
appendStringInfo(buf, "reuse_page: rel %u/%u/%u; latestRemovedXid %u",
xlrec->node.spcNode, xlrec->node.dbNode,
xlrec->node.relNode, xlrec->latestRemovedXid);
break;
}
default: default:
appendStringInfo(buf, "UNKNOWN"); appendStringInfo(buf, "UNKNOWN");
break; break;
......
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