Change a couple of "can't happen" error messages to be a shade more
authorTom Lane <[email protected]>
Fri, 12 Aug 2005 14:34:14 +0000 (14:34 +0000)
committerTom Lane <[email protected]>
Fri, 12 Aug 2005 14:34:14 +0000 (14:34 +0000)
verbose when they do happen.  The "left link changed unexpectedly"
one in particular has been seen more than once in the field.

src/backend/access/nbtree/nbtpage.c

index 488e89c217d8b30cba79ef91f07a4b7a786fb5e8..718998b72ab501ea4bcb6e1946489117d138d42a 100644 (file)
@@ -826,7 +826,8 @@ _bt_pagedel(Relation rel, Buffer buf, bool vacuum_full)
                        _bt_relbuf(rel, lbuf);
                        if (leftsib == P_NONE)
                        {
-                               elog(LOG, "no left sibling (concurrent deletion?)");
+                               elog(LOG, "no left sibling (concurrent deletion?) in \"%s\"",
+                                        RelationGetRelationName(rel));
                                return 0;
                        }
                        lbuf = _bt_getbuf(rel, leftsib, BT_WRITE);
@@ -861,7 +862,8 @@ _bt_pagedel(Relation rel, Buffer buf, bool vacuum_full)
                return 0;
        }
        if (opaque->btpo_prev != leftsib)
-               elog(ERROR, "left link changed unexpectedly");
+               elog(ERROR, "left link changed unexpectedly in block %u of \"%s\"",
+                        target, RelationGetRelationName(rel));
 
        /*
         * And next write-lock the (current) right sibling.
@@ -984,8 +986,8 @@ _bt_pagedel(Relation rel, Buffer buf, bool vacuum_full)
                itemid = PageGetItemId(page, nextoffset);
                btitem = (BTItem) PageGetItem(page, itemid);
                if (ItemPointerGetBlockNumber(&(btitem->bti_itup.t_tid)) != rightsib)
-                       elog(PANIC, "right sibling is not next child");
-
+                       elog(PANIC, "right sibling is not next child in \"%s\"",
+                                RelationGetRelationName(rel));
                PageIndexTupleDelete(page, nextoffset);
        }