|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.114 2001/06/29 21:08:24 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.115 2001/07/02 18:47:18 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -198,13 +198,22 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
|
198 | 198 | /* if it's already in the buffer pool, we're done */
|
199 | 199 | if (found)
|
200 | 200 | {
|
201 |
| -/* |
202 |
| - * Could have found && isExtend if a buffer was already created for |
203 |
| - * the next page position, but then smgrextend failed to write |
204 |
| - * the page. Must fall through and try to extend file again. |
205 |
| - */ |
| 201 | +/* That is, we're done if we expected to be able to find it ... */ |
206 | 202 | if (!isExtend)
|
207 | 203 | returnBufferDescriptorGetBuffer(bufHdr);
|
| 204 | +/* |
| 205 | + * If we found a buffer when we were expecting to extend the relation, |
| 206 | + * the implication is that a buffer was already created for the next |
| 207 | + * page position, but then smgrextend failed to write the page. |
| 208 | + * We'd better try the smgrextend again. But since BufferAlloc |
| 209 | + * won't have done StartBufferIO, we must do that first. |
| 210 | + */ |
| 211 | +if (!isLocalBuf) |
| 212 | +{ |
| 213 | +SpinAcquire(BufMgrLock); |
| 214 | +StartBufferIO(bufHdr, false); |
| 215 | +SpinRelease(BufMgrLock); |
| 216 | +} |
208 | 217 | }
|
209 | 218 |
|
210 | 219 | /*
|
|