Re: streaming replication breaks horribly if master crashes - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: streaming replication breaks horribly if master crashes
Date
Msg-id AANLkTinEbdLGrdBO8zvRwSLVV82l4uXArku8qtrhQIL0@mail.gmail.com
Whole thread Raw
In response to Re: streaming replication breaks horribly if master crashes  (Rafael Martinez <r.m.guerrero@usit.uio.no>)
Responses Re: streaming replication breaks horribly if master crashes
List pgsql-hackers
On Thu, Jun 17, 2010 at 4:02 PM, Rafael Martinez
<r.m.guerrero@usit.uio.no> wrote:
> I tested this yesterday and I could not get any reaction from the wal
> receiver even after using minimal values compared to the default values  .
>
> The default values in linux for tcp_keepalive_time, tcp_keepalive_intvl
> and tcp_keepalive_probes are 7200, 75 and 9. I reduced these values to
> 60, 3, 3 and nothing happened, it continuous with status ESTABLISHED
> after 60+3*3 seconds.
>
> I did not restart the network after I changed these values on the fly
> via /proc. I wonder if this is the reason the connection didn't die
> neither with the new keppalive values after the connection was broken. I
> will check this later today.

Walreceiver uses libpq to communicate with the master. But keepalive is not
enabled in libpq currently. That is libpq code doesn't call something like
setsockopt(SOL_SOCKET, SO_KEEPALIVE). So even if you change the kernel options
for keepalive, it has no effect on walreceiver.

Regards,

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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Debug message in RemoveOldXlogFiles
Next
From: Magnus Hagander
Date:
Subject: Re: streaming replication breaks horribly if master crashes