Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLZUp-0007jE-Du; Tue, 09 Oct 2012 13:05:15 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLZUj-0006m7-EO; Tue, 09 Oct 2012 13:05:14 +0000 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id AQH25830; Tue, 09 Oct 2012 21:04:59 +0800 (CST) Received: from SZXEML408-HUB.china.huawei.com (10.82.67.95) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.1.323.3; Tue, 9 Oct 2012 21:04:31 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml408-hub.china.huawei.com (10.82.67.95) with Microsoft SMTP Server id 14.1.323.3; Tue, 9 Oct 2012 21:04:32 +0800 From: Amit Kapila To: "'Robert Haas'" CC: "'Heikki Linnakangas'" , "'Fujii Masao'" , , References: <50515fcd.c32f320a.4297.ffffb186SMTPIN_ADDED@mx.google.com> <6C0B27F7206C9E4CA54AE035729E9C382853264E@szxeml509-mbs> <6C0B27F7206C9E4CA54AE035729E9C382853288B@szxeml509-mbs> <5056cb6b.29f2440a.7bd9.1633SMTPIN_ADDED@mx.google.com> <6C0B27F7206C9E4CA54AE035729E9C38285337FF@szxeml509-mbs> <506972B9.6060104@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C38285358F7@szxeml509-mbs> <506AA530.30106@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C382853645A@szxeml509-mbs> <5072e70c.aad9d80a.5316.ffffc61fSMTPIN_ADDED@mx.google.com> In-Reply-To: Subject: Re: [HACKERS] BUG #7534: walreceiver takes long time to detect n/w breakdown Date: Tue, 9 Oct 2012 18:34:31 +0530 Message-ID: <00ae01cda61e$9fe90290$dfbb07b0$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac2mGcv3WQh5eVxhQKSbpY3BQeAKwAAAgWGw Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -3.0 (---) X-Archive-Number: 201210/66 X-Sequence-Number: 34366 On Tuesday, October 09, 2012 6:00 PM Robert Haas wrote: > On Mon, Oct 8, 2012 at 10:42 AM, Amit Kapila > wrote: > > How about following: > > 1. replication_client_timeout -- shouldn't it be client as new > configuration > > is for wal receiver > > 2. replication_standby_timeout > > ISTM that the client and the standby are the same thing. Yeah same, but may be one (replication_standby_timeout) can be more easily understandable by user. > > If we introduce a new parameter for wal receiver, wouldn't > > replication_timeout be confusing for user? > > Maybe. > I actually don't think that I understand what problem we're > trying to solve here. If the connection between the master and the > standby is lost, shouldn't the standby realize that it's no longer > receiving keepalives from the master and terminate the connection? For wal receiver keepalives are also like one kind of message, so the behavior is such that when it checks that it doesn't receive any message, it tries to send reply/feedback message to master after an interval of wal_receiver_status_interval. So after every wal_receiver_status_interval, wal receiver sends a reply, but still the socket send doesn't fail. It fails only after many send calls as internally might be in send(), until the sockets internal buffer is full, it keeps accumulating even if other side recv has not received the data. So that's the reason we decided to introduce a timeout parameter in wal receiver similar to what we have currently in walsender. > I > thought I had tested this at some point and it was working, so either > it's subsequently gotten broken again or the scenario you're talking > about is different in some way that I don't currently understand. Standby takes quite longer around 15 minutes to detect whereas master is able to detect quite sooner in 2-3 mins and master also mainly detects due to timeout functionality in wal sender. With Regards, Amit Kapila.