Re: Synchronous replication

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Yeb Havinga <yebhavinga@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-08-05T10:40:32Z
Lists: pgsql-hackers

Attachments

On Wed, Aug 4, 2010 at 12:35 AM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> 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.

Yep. To avoid that race condition, xlogsend_requested should be reset to
false after sleep and before calling XLogSend(). I attached the updated
version of the patch.

Of course, the code is also available in my git repository:
git://git.postgresql.org/git/users/fujii/postgres.git
branch: wakeup-walsnd

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center