I wrote: > I think that it would work for BufferAlloc to share-lock the victim > buffer before calling FlushBuffer; we'd have to add a bool parameter to > FlushBuffer telling it the lock was already acquired.
I've applied a patch for this. > BTW, it looks to me like this deadlock potential has existed at least > since 7.0. I seem to recall one or two reports of unexplainable > apparent deadlocks, which perhaps are now explained. On closer investigation the deadlock does not seem to exist in 7.4 and before, because BufferReplace didn't acquire the buffer sharelock. (There is a comment in the 7.4 code claiming that we didn't need to, but I'm unconvinced that it's correct...) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster