Re: Synchronous replication - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Synchronous replication
Date
Msg-id 4C583753.70709@enterprisedb.com
Whole thread Raw
In response to Re: Synchronous replication  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Synchronous replication
List pgsql-hackers
On 27/07/10 13:29, Fujii Masao wrote:
> On Tue, Jul 27, 2010 at 7:39 PM, Yeb Havinga<yebhavinga@gmail.com>  wrote:
>> Fujii Masao wrote:
>> I noted the changes in XlogSend where instead of *caughtup = true/false it
>> now returns !MyWalSnd->sndrqst. That value is initialized to false in that
>> procedure and it cannot be changed to true during execution of that
>> procedure, or can it?
>
> That value is set to true in WalSndWakeup(). If WalSndWakeup() is called
> after initialization of that value in XLogSend(), *caughtup is set to false.

There's some race conditions with the signaling. If another process 
finishes XLOG flush and sends the signal when a walsender has just 
finished one iteration of its main loop, walsender will reset 
xlogsend_requested and go to sleep. It should not sleep but send the 
pending WAL immediately.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: documentation for committing with git
Next
From: Boxuan Zhai
Date:
Subject: Re: merge command - GSoC progress