diff options
| author | Tom Lane | 2003-08-10 19:48:08 +0000 |
|---|---|---|
| committer | Tom Lane | 2003-08-10 19:48:08 +0000 |
| commit | ffafacc1f6e403b81180aa20d0a4184ce92beef8 (patch) | |
| tree | a85699334c2bcffee5ccaec9d4b37e90de438d67 /src/include | |
| parent | 18c10877a9b7d5e3766f6f34c827892a33872567 (diff) | |
Repair potential deadlock created by recent changes to recycle btree
index pages: when _bt_getbuf asks the FSM for a free index page, it is
possible (and, in some cases, even moderately likely) that the answer
will be the same page that _bt_split is trying to split. _bt_getbuf
already knew that the returned page might not be free, but it wasn't
prepared for the possibility that even trying to lock the page could
be problematic. Fix by doing a conditional rather than unconditional
grab of the page lock.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/bufmgr.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 5d78a3b9b2a..bfbf64e207f 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.69 2003/08/04 02:40:14 momjian Exp $ + * $Id: bufmgr.h,v 1.70 2003/08/10 19:48:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -180,6 +180,7 @@ extern void SetBufferCommitInfoNeedsSave(Buffer buffer); extern void UnlockBuffers(void); extern void LockBuffer(Buffer buffer, int mode); +extern bool ConditionalLockBuffer(Buffer buffer); extern void LockBufferForCleanup(Buffer buffer); extern void AbortBufferIO(void); |
