]> granicus.if.org Git - postgresql/commit
Repair bufmgr deadlock problem reported by Michael Wildpaner. Must take
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Jan 2005 18:49:41 +0000 (18:49 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Jan 2005 18:49:41 +0000 (18:49 +0000)
commitc9d8edc9064a09dad7cd964144e3b3a915212ed7
treefc1ec7d3918f3760df84a9892aeb9f2dc98835fe
parent4ea43bdfdf377a0e400f1e1c2fc6f4e2407b5740
Repair bufmgr deadlock problem reported by Michael Wildpaner.  Must take
share lock on a buffer being written out before releasing BufMgrLock in
the BufferAlloc code path; if we do it later we might block on someone
who's re-pinned the buffer.  I believe this is only an issue for BufferAlloc
and not the other places that call FlushBuffer.  BufferSync must continue
to do it the old way since it may well be trying to write buffers that
other backends have pinned; but it should not be holding any conflicting
locks.  FlushRelationBuffers is okay since it's got exclusive lock at the
relation level.
src/backend/storage/buffer/bufmgr.c