Hi, On 2018-11-12 15:58:41 +1300, Thomas Munro wrote: > There is one major problem with this patch: BufferSync(), run in the > checkpointer, can deadlock against a backend that holds a buffer lock > and is blocked in SendFsyncRequest(). To break this deadlock, we need > way out of it on either the sending or receiving side. Here are three > ideas:
That's the deadlock I'd mentioned in Pune (?) btw. > 1. Go back to the current pressure-valve strategy: make the sending > side perform the fsync(), if it can't immediately write to the pipe. I don't think that's correct / safe? I've previously wondered whether there's any way we could delay the write to a point where the buffer is not locked anymore - as far as I can tell it's actually not required for correctness that we send the fsync request before unlocking. It's architecturally a bit dicey tho :( Greetings, Andres Freund