Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown - Mailing list pgsql-hackers

From Amit kapila
Subject Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
Date
Msg-id 6C0B27F7206C9E4CA54AE035729E9C382853264E@szxeml509-mbs
Whole thread Raw
In response to Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Thursday, September 13, 2012 10:57 PM Fujii Masao
On Thu, Sep 13, 2012 at 1:22 PM, Amit Kapila <amit.kapila@huawei.com> wrote:
> On Wednesday, September 12, 2012 10:15 PM Fujii Masao
> On Wed, Sep 12, 2012 at 8:54 PM,  <amit.kapila@huawei.com> wrote:
>>>> The following bug has been logged on the website:
>>>
>>>> Bug reference:      7534
>>>> Logged by:          Amit Kapila
>>>> Email address:      amit.kapila@huawei.com
>>>> PostgreSQL version: 9.2.0
>>>> Operating system:   Suse 10
>>>> Description:
>>
>>>> 1. Both master and standby machine are connected normally,
>>>> 2. then you use the command: ifconfig ip down; make the network card of
>>>> master and standby down,
>>
>>>> Observation
>>>> master can detect connect abnormal, but the standby can't detect connect
>>>> abnormal and show a connected channel long time.
>
>
>>  I would like to implement such feature for walreceiver, but there is one
>> confusion that whether to use
>>  same configuration parameter(replication_timeout) for walrecevier as for
>> master or introduce a new
>>  configuration parameter (receiver_replication_timeout).

>I like the latter. I believe some users want to set the different
>timeout values,
>for example, in the case where the master and standby servers are placed in
>the same room, but cascaded standby is placed in other continent.

Thank you for your suggestion. I have implemented as per your suggestion to have separate timeout parameter for
walreceiver.
The main changes are:
1. Introduce a new configuration parameter wal_receiver_replication_timeout for walreceiver.
2. In function WalReceiverMain(), check if there is no communication till wal_receiver_replication_timeout, exit the
walreceiver.
    This is same as walsender functionality.

As this is a feature, So I am uploading the attached patch in coming CommitFest.

Suggestions/Comments?

With Regards,
Amit Kapila.
Attachment

pgsql-hackers by date:

Previous
From: Amit kapila
Date:
Subject: Re: Proof of concept: standalone backend with full FE/BE protocol
Next
From: Aidan Van Dyk
Date:
Subject: Re: Cause of recent buildfarm failures on hamerkop