mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
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.
This commit is contained in:
@ -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)
|
|||||||
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)
|
|||||||
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)
|
|||||||
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)
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user