Re: Refactoring the checkpointer's fsync request queue - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Refactoring the checkpointer's fsync request queue
Date
Msg-id 20181113180114.hqporqfdnbyvlx7q@alap3.anarazel.de
Whole thread Raw
In response to Re: Refactoring the checkpointer's fsync request queue  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Jean-Christophe Arnu
Date:
Subject: Re: wal_dump output on CREATE DATABASE
Next
From: Andres Freund
Date:
Subject: Re: Refactoring the checkpointer's fsync request queue