Re: Synchronous replication

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Yeb Havinga <yebhavinga(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Synchronous replication
Date: 2010-08-03 15:35:47
Message-ID: 4C583753.70709@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27/07/10 13:29, Fujii Masao wrote:
> On Tue, Jul 27, 2010 at 7:39 PM, Yeb Havinga<yebhavinga(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2010-08-03 16:23:04 Re: Develop item from TODO list
Previous Message Yeb Havinga 2010-08-03 15:34:05 Re: patch for check constraints using multiple inheritance