Re: WalSndWakeup() and synchronous_commit=off

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WalSndWakeup() and synchronous_commit=off
Date: 2012-05-11 20:45:42
Message-ID: CA+U5nMJ=HS-3n4fO_P68MU=pb18+uUwyJ-UB5dZrbbGHThcTsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 May 2012 19:45, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andres Freund <andres(at)2ndquadrant(dot)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?

I think because nobody thought of that.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-05-11 20:50:01 Re: checkpointer code behaving strangely on postmaster -T
Previous Message Tom Lane 2012-05-11 18:45:23 Re: WalSndWakeup() and synchronous_commit=off