Re: Replication server timeout patch

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Replication server timeout patch
Date: 2011-03-30 07:58:25
Message-ID: AANLkTinmDL8pmvjC7sNCmdS5BMjq=F23iTAJtKdnej=N@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 30, 2011 at 4:24 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> +       pq_putmessage_noblock('d', msgbuf, 1 +
>> sizeof(WalDataMessageHeader) + nbytes);
>>
>> Don't we need to check the return value of pq_putmessage_noblock? That
>> can return EOF when trouble happens (for example the send system call
>> fails).
>
> No, pq_putmessage_noblock doesn't call send() because it enlarges the buffer
> to make sure the message fits, and it doesn't anything else that could fail
> else. I changed its return type to void, and added an Assert() to check that
> the pq_putmessage() call it does internally indeed doesn't fail.

Oh, you're right.

> Committed with those changes. I also reworded the docs a bit.

Thanks a lot!

+ A value of zero means wait forever. This parameter can only be set in

The first sentence sounds misleading. Even if you set the parameter to zero,
replication connections can be terminated because of keepalive or socket error.

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 Heikki Linnakangas 2011-03-30 08:03:33 Re: Replication server timeout patch
Previous Message Heikki Linnakangas 2011-03-30 07:56:43 Re: Problem with streaming replication, backups, and recovery (9.0.x)