]> granicus.if.org Git - postgresql/commitdiff
Debug stuff added to BlowawayRelationBuffers().
authorVadim B. Mikheev <vadim4o@yahoo.com>
Wed, 22 Oct 1997 19:04:43 +0000 (19:04 +0000)
committerVadim B. Mikheev <vadim4o@yahoo.com>
Wed, 22 Oct 1997 19:04:43 +0000 (19:04 +0000)
src/backend/storage/buffer/bufmgr.c

index f8b6c579c83261bbb3523c36c25929fed889cf1f..f6fc503d4badc857e258b7aa11b0fd956f86d2a7 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.27 1997/10/12 07:12:02 vadim Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.28 1997/10/22 19:04:43 vadim Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1631,9 +1631,18 @@ BlowawayRelationBuffers(Relation rdesc, BlockNumber block)
                                buf->tag.blockNum >= block)
                        {
                                if (buf->flags & BM_DIRTY)
+                               {
+                                       elog (NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is dirty",
+                                               rdesc->rd_rel->relname.data, block, buf->tag.blockNum);
                                        return (-1);
+                               }
                                if (LocalRefCount[i] > 0)
+                               {
+                                       elog (NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is referenced (%d)",
+                                               rdesc->rd_rel->relname.data, block, 
+                                               buf->tag.blockNum, LocalRefCount[i]);
                                        return (-2);
+                               }
                                buf->tag.relId.relId = InvalidOid;
                        }
                }
@@ -1650,11 +1659,17 @@ BlowawayRelationBuffers(Relation rdesc, BlockNumber block)
                {
                        if (buf->flags & BM_DIRTY)
                        {
+                               elog (NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is dirty (private %d, last %d, global %d)",
+                                       buf->sb_relname, block, buf->tag.blockNum, 
+                                       PrivateRefCount[i], LastRefCount[i], buf->refcount);
                                SpinRelease(BufMgrLock);
                                return (-1);
                        }
                        if (!(buf->flags & BM_FREE))
                        {
+                               elog (NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is referenced (private %d, last %d, global %d)",
+                                       buf->sb_relname, block, buf->tag.blockNum, 
+                                       PrivateRefCount[i], LastRefCount[i], buf->refcount);
                                SpinRelease(BufMgrLock);
                                return (-2);
                        }