Re: WalSndWakeup() and synchronous_commit=off - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WalSndWakeup() and synchronous_commit=off
Date
Msg-id 11171.1336761923@sss.pgh.pa.us
Whole thread Raw
In response to Re: WalSndWakeup() and synchronous_commit=off  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: WalSndWakeup() and synchronous_commit=off  (Simon Riggs <simon@2ndQuadrant.com>)
Re: WalSndWakeup() and synchronous_commit=off  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> Its the only place though which knows whether its actually sensible to wakeup 
> the walsender. We could make it return whether it wrote anything and do the 
> wakeup at the callers. I count 4 different callsites which would be an 
> annoying duplication but I don't really see anything better right now.

Another point here is that XLogWrite is not only normally called with
the lock held, but inside a critical section.  I see no reason to take
the risk of doing signal sending inside critical sections.

BTW, a depressingly large fraction of the existing calls to WalSndWakeup
are also inside critical sections, generally for no good reason that I
can see.  For example, in EndPrepare(), why was the call placed where
it is and not down beside SyncRepWaitForLSN?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: WalSndWakeup() and synchronous_commit=off
Next
From: Simon Riggs
Date:
Subject: Re: WalSndWakeup() and synchronous_commit=off