Commit c19dadbf authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Runtime btree recovery is now ON by default.

parent 66decbfb
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.49 2001/01/29 07:28:17 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.50 2001/02/07 23:35:33 vadim Exp $
* *
* NOTES * NOTES
* Postgres btree pages look like ordinary relation pages. The opaque * Postgres btree pages look like ordinary relation pages. The opaque
...@@ -249,15 +249,15 @@ _bt_getroot(Relation rel, int access) ...@@ -249,15 +249,15 @@ _bt_getroot(Relation rel, int access)
Buffer newrootbuf; Buffer newrootbuf;
check_parent:; check_parent:;
if (rootopaque->btpo_parent == BTREE_METAPAGE) /* unupdated! */ if (BTreeInvalidParent(rootopaque)) /* unupdated! */
{ {
LockBuffer(rootbuf, BUFFER_LOCK_UNLOCK); LockBuffer(rootbuf, BUFFER_LOCK_UNLOCK);
LockBuffer(rootbuf, BT_WRITE); LockBuffer(rootbuf, BT_WRITE);
/* handle concurrent fix of root page */ /* handle concurrent fix of root page */
if (rootopaque->btpo_parent == BTREE_METAPAGE) /* unupdated! */ if (BTreeInvalidParent(rootopaque)) /* unupdated! */
{ {
elog(NOTICE, "bt_getroot: fixing root page"); elog(NOTICE, "bt_getroot[%s]: fixing root page", RelationGetRelationName(rel));
newrootbuf = _bt_fixroot(rel, rootbuf, true); newrootbuf = _bt_fixroot(rel, rootbuf, true);
LockBuffer(newrootbuf, BUFFER_LOCK_UNLOCK); LockBuffer(newrootbuf, BUFFER_LOCK_UNLOCK);
LockBuffer(newrootbuf, BT_READ); LockBuffer(newrootbuf, BT_READ);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.77 2001/01/29 00:39:14 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.78 2001/02/07 23:35:33 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -37,7 +37,7 @@ bool FastBuild = true; /* use sort/build instead */ ...@@ -37,7 +37,7 @@ bool FastBuild = true; /* use sort/build instead */
* TEMPORARY FLAG FOR TESTING NEW FIX TREE * TEMPORARY FLAG FOR TESTING NEW FIX TREE
* CODE WITHOUT AFFECTING ANYONE ELSE * CODE WITHOUT AFFECTING ANYONE ELSE
*/ */
bool FixBTree = false; bool FixBTree = true;
static void _bt_restscan(IndexScanDesc scan); static void _bt_restscan(IndexScanDesc scan);
......
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