Re: Replication server timeout patch

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Replication server timeout patch
Date: 2011-03-06 08:03:21
Message-ID: AANLkTin-Hxet+FX+4SZ1DxgCJm-LqoVAwaog16DA8g3d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 6, 2011 at 3:23 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Feb 28, 2011 at 8:08 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Sun, Feb 27, 2011 at 11:52 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>>> There are two things that I think are pretty clear.  If the receiver
>>>> has wal_receiver_status_interval=0, then we should ignore
>>>> replication_timeout for that connection.
>>>
>>> The patch still doesn't check that wal_receiver_status_interval
>>> is set up properly. I'll implement that later.
>>
>> Done. I attached the updated patch.
>
> Why does internal_flush_if_writable compute bufptr differently from
> internal_flush?  And shouldn't it be static?
>
> It seems to me that this ought to be refactored so that you don't
> duplicate so much code.  Maybe static int internal_flush(bool
> nonblocking).
>
> I don't think that the while (bufptr < bufend) loop needs to contain
> the code to set and clear the nonblocking state.  You could do the
> whole loop with nonblocking mode turned on and then reenable it just
> once at the end.  Besides possibly being clearer, that would be more
> efficient and leave less room for unexpected failures.

All these comments seem to make sense. Will fix. Thanks!

Regards,

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-03-06 08:21:13 Re: Sync Rep v19
Previous Message Fujii Masao 2011-03-06 07:58:19 Re: Sync Rep v19