|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.167 2004/05/3103:48:02 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.168 2004/05/3119:24:05 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1287,9 +1287,7 @@ PrintPinnedBufs(void)
|
1287 | 1287 | *
|
1288 | 1288 | *This function writes all dirty pages of a relation out to disk.
|
1289 | 1289 | *Furthermore, pages that have blocknumber >= firstDelBlock are
|
1290 |
| - *actually removed from the buffer pool.An error code is returned |
1291 |
| - *if we fail to dump a dirty buffer or if we find one of |
1292 |
| - *the target pages is pinned into the cache. |
| 1290 | + *actually removed from the buffer pool. |
1293 | 1291 | *
|
1294 | 1292 | *This is called by DROP TABLE to clear buffers for the relation
|
1295 | 1293 | *from the buffer pool. Note that we must write dirty buffers,
|
@@ -1319,13 +1317,11 @@ PrintPinnedBufs(void)
|
1319 | 1317 | *to still be present in the cache due to failure of an earlier
|
1320 | 1318 | *transaction. So, must flush dirty buffers without complaint.
|
1321 | 1319 | *
|
1322 |
| - *Returns: 0 - Ok, -1 - FAILED TO CLEAR DIRTY BIT, -2 - PINNED |
1323 |
| - * |
1324 | 1320 | *XXX currently it sequentially searches the buffer pool, should be
|
1325 | 1321 | *changed to more clever ways of searching.
|
1326 | 1322 | * --------------------------------------------------------------------
|
1327 | 1323 | */
|
1328 |
| -int |
| 1324 | +void |
1329 | 1325 | FlushRelationBuffers(Relationrel,BlockNumberfirstDelBlock)
|
1330 | 1326 | {
|
1331 | 1327 | inti;
|
@@ -1364,18 +1360,15 @@ FlushRelationBuffers(Relation rel, BlockNumber firstDelBlock)
|
1364 | 1360 | error_context_stack=errcontext.previous;
|
1365 | 1361 | }
|
1366 | 1362 | if (LocalRefCount[i]>0)
|
1367 |
| -{ |
1368 |
| -elog(WARNING,"FlushRelationBuffers(\"%s\" (local), %u): block %u is referenced (%d)", |
| 1363 | +elog(ERROR,"FlushRelationBuffers(\"%s\" (local), %u): block %u is referenced (%d)", |
1369 | 1364 | RelationGetRelationName(rel),firstDelBlock,
|
1370 | 1365 | bufHdr->tag.blockNum,LocalRefCount[i]);
|
1371 |
| -return (-2); |
1372 |
| -} |
1373 | 1366 | if (bufHdr->tag.blockNum >=firstDelBlock)
|
1374 | 1367 | bufHdr->tag.rnode.relNode=InvalidOid;
|
1375 | 1368 | }
|
1376 | 1369 | }
|
1377 | 1370 |
|
1378 |
| -return0; |
| 1371 | +return; |
1379 | 1372 | }
|
1380 | 1373 |
|
1381 | 1374 | LWLockAcquire(BufMgrLock,LW_EXCLUSIVE);
|
@@ -1403,31 +1396,21 @@ FlushRelationBuffers(Relation rel, BlockNumber firstDelBlock)
|
1403 | 1396 | }
|
1404 | 1397 | UnpinBuffer(bufHdr);
|
1405 | 1398 | if (bufHdr->flags&BM_DIRTY||bufHdr->cntxDirty)
|
1406 |
| -{ |
1407 |
| -LWLockRelease(BufMgrLock); |
1408 |
| -elog(WARNING,"FlushRelationBuffers(\"%s\", %u): block %u was re-dirtied", |
| 1399 | +elog(ERROR,"FlushRelationBuffers(\"%s\", %u): block %u was re-dirtied", |
1409 | 1400 | RelationGetRelationName(rel),firstDelBlock,
|
1410 | 1401 | bufHdr->tag.blockNum);
|
1411 |
| -return-1; |
1412 |
| -} |
1413 | 1402 | }
|
1414 | 1403 | if (bufHdr->refcount!=0)
|
1415 |
| -{ |
1416 |
| -LWLockRelease(BufMgrLock); |
1417 |
| -elog(WARNING,"FlushRelationBuffers(\"%s\", %u): block %u is referenced (private %d, global %u)", |
| 1404 | +elog(ERROR,"FlushRelationBuffers(\"%s\", %u): block %u is referenced (private %d, global %u)", |
1418 | 1405 | RelationGetRelationName(rel),firstDelBlock,
|
1419 | 1406 | bufHdr->tag.blockNum,
|
1420 | 1407 | PrivateRefCount[i],bufHdr->refcount);
|
1421 |
| -return-2; |
1422 |
| -} |
1423 | 1408 | if (bufHdr->tag.blockNum >=firstDelBlock)
|
1424 | 1409 | StrategyInvalidateBuffer(bufHdr);
|
1425 | 1410 | }
|
1426 | 1411 | }
|
1427 | 1412 |
|
1428 | 1413 | LWLockRelease(BufMgrLock);
|
1429 |
| - |
1430 |
| -return0; |
1431 | 1414 | }
|
1432 | 1415 |
|
1433 | 1416 | /*
|
|