]> granicus.if.org Git - postgresql/commit
Repair potential deadlock created by recent changes to recycle btree
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Aug 2003 19:48:08 +0000 (19:48 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Aug 2003 19:48:08 +0000 (19:48 +0000)
commitffafacc1f6e403b81180aa20d0a4184ce92beef8
treea85699334c2bcffee5ccaec9d4b37e90de438d67
parent18c10877a9b7d5e3766f6f34c827892a33872567
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.
src/backend/access/nbtree/nbtpage.c
src/backend/storage/buffer/bufmgr.c
src/include/storage/bufmgr.h