Re: WalSndWakeup() and synchronous_commit=off

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WalSndWakeup() and synchronous_commit=off
Date: 2012-05-11 18:36:24
Message-ID: 10124.1336761384@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> That definitely doesn't seem ideal - a lot of things can pile up
> behind WALWriteLock. I'm not sure how big a problem it would be in
> practice, but we generally make a practice of avoiding sending signals
> while holding LWLocks whenever possible...

There's a good reason for that, which is that the scheduler might well
decide to go run the wakened process instead of you. Admittedly this
tends to not be a problem on machines with $bignum CPUs, but on
single-CPU machines I've seen it happen a lot.

Refactoring so that the signal is sent only after lock release seems
like a good idea to me.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-05-11 18:40:40 Re: WalSndWakeup() and synchronous_commit=off
Previous Message Josh Berkus 2012-05-11 18:21:35 Agenda For 3rd Cluster Hackers Summit, May 15th in Ottawa