Skip to content

Commit cef01c3

Browse files
committed
Avoid infinite loop in InvalidateBuffer if we ourselves are holding
a pin on the victim buffer.
1 parent afb66ad commit cef01c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.186 2005/03/04 20:21:06 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.187 2005/03/18 05:25:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -551,6 +551,9 @@ InvalidateBuffer(BufferDesc *buf)
551551
{
552552
UnlockBufHdr_NoHoldoff(buf);
553553
LWLockRelease(BufMappingLock);
554+
/* safety check: should definitely not be our *own* pin */
555+
if (PrivateRefCount[buf->buf_id] != 0)
556+
elog(ERROR, "buffer is pinned in InvalidateBuffer");
554557
WaitIO(buf);
555558
goto retry;
556559
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy