Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw5nP-0006Zf-07 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 06:51:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tw5nO-000649-Af for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 06:51:22 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw5nM-000643-Um for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 06:51:21 +0000 Received: from szxga01-in.huawei.com ([119.145.14.64]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tw5nJ-0003xv-6q for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 06:51:20 +0000 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id AWC66845; Fri, 18 Jan 2013 14:51:08 +0800 (CST) Received: from SZXEML458-HUB.china.huawei.com (10.82.67.201) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.1.323.3; Fri, 18 Jan 2013 14:51:05 +0800 Received: from blrprnc09ns (10.18.96.98) by SZXEML458-HUB.china.huawei.com (10.82.67.201) with Microsoft SMTP Server id 14.1.323.3; Fri, 18 Jan 2013 14:51:01 +0800 From: Amit Kapila To: "'Heikki Linnakangas'" , "'Boszormenyi Zoltan'" CC: "'Hari Babu'" , "'Fujii Masao'" , References: <506972B9.6060104@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C38285358F7@szxeml509-mbs> <506AA530.30106@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C382853645A@szxeml509-mbs> <507597E2.8090701@vmware.com> <5076DD38.8020804@vmware.com> <507BE1AD.2060709@vmware.com> <507e9adc.43db440a.5351.fffff4d0SMTPIN_ADDED@mx.google.com> <6C0B27F7206C9E4CA54AE035729E9C382853BBED@szxeml509-mbs> <509B6E66.9070408@vmware.com> <509c9cd1.494f420a.3fc7.4362SMTPIN_ADDED@mx.google.com>, <6C0B27F7206C9E4CA54AE035729E9C38285499FA@szxeml509-mbx> <50E31370.5030405@cybertec.at> <007701cdea79$0cf35b30$26da1190$@kommi@huawei.co m> <50EADA46.60802@cybertec.at> <50F6819A.8020000@vmwar e.com> In-Reply-To: <50F6819A.8020000@vmware.com> Subject: Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown Date: Fri, 18 Jan 2013 12:20:58 +0530 Message-ID: <03b701cdf548$2cfd7170$86f85450$@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: Ac3z1LF9+ZLoq/CYRsCsbvFyIzIvDwBcYseQ Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wednesday, January 16, 2013 4:02 PM Heikki Linnakangas wrote: > On 07.01.2013 16:23, Boszormenyi Zoltan wrote: > > Since my other patch against pg_basebackup is now committed, > > this patch doesn't apply cleanly, patch rejects 2 hunks. > > The fixed up patch is attached. > > Now that I look at this a high-level perspective, why are we only > worried about timeouts in the Copy-mode and when connecting? The > initial > checkpoint could take a long time too, and if the server turns into a > black hole while the checkpoint is running, pg_basebackup will still > hang. Then again, a short timeout on that phase would be a bad idea, > because the checkpoint can indeed take a long time. True, but IMO, if somebody want to take basebackup, he should do that when the server is not loaded. > In streaming replication, the keep-alive messages carry additional > information, the timestamps and WAL locations, so a keepalive makes > sense at that level. But otherwise, aren't we just trying to > reimplement > TCP keepalives? TCP keepalives are not perfect, but if we want to have > an application level timeout, it should be implemented in the FE/BE > protocol. > > I don't think we need to do anything specific to pg_basebackup. The > user > can simply specify TCP keepalive settings in the connection string, > like > with any libpq program. I think currently user has no way to specify TCP keepalive settings from pg_basebackup, please let me know if there is any such existing way? I think specifying TCP settings is very cumbersome for most users, that's the reason most standard interfaces (ODBC/JDBC) have such application level timeout mechanism. By implementing in FE/BE protocol (do you mean to say that make such non-blocking behavior inside Libpq or something else), it might be generic and can be used for others as well but it might need few interface changes. IMHO if by having such less impact changes for pg_basebackup, it makes pg_basebackup network sensitive, the current approach can also be considered. With Regards, Amit Kapila. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers