Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A224F1336971 for ; Fri, 28 Jan 2011 05:15:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 13726-03 for ; Fri, 28 Jan 2011 09:15:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og120.obsmtp.com (exprod7og120.obsmtp.com [64.18.2.18]) by mail.postgresql.org (Postfix) with ESMTP id 8B1C7133616B for ; Fri, 28 Jan 2011 05:15:14 -0400 (AST) Received: from source ([209.85.215.51]) (using TLSv1) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKTUKJIet/pC0uAPHm5QwAUjxVkZGJ4DXy@postini.com; Fri, 28 Jan 2011 01:15:15 PST Received: by ewy19 with SMTP id 19so1333906ewy.38 for ; Fri, 28 Jan 2011 01:15:12 -0800 (PST) Received: by 10.213.35.3 with SMTP id n3mr4486904ebd.36.1296206110806; Fri, 28 Jan 2011 01:15:10 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id t5sm13646922eeh.8.2011.01.28.01.15.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Jan 2011 01:15:09 -0800 (PST) Message-ID: <4D42891B.7040609@enterprisedb.com> Date: Fri, 28 Jan 2011 11:15:07 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: zoulx1982 CC: PostgreSQL Bugs Subject: Re: =?x-gbk?Q?=BB=D8=B8=B4=3ARe=3A_=BB=D8=B8=B4=3ARe=3A_=5BB?= =?x-gbk?Q?UGS=5D_BUG_=235853=3A_when_the_walsender_cannot_?= =?x-gbk?Q?exit_when_reboot_slave_computer?= References: <55f972f3.5a8.12dcb625a4d.Coremail.zoulx1982@163.com> In-Reply-To: <55f972f3.5a8.12dcb625a4d.Coremail.zoulx1982@163.com> Content-Type: text/plain; charset=x-gbk; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201101/231 X-Sequence-Number: 29253 (I repeat: please keep the mailing list cc'd so that other can help) On 28.01.2011 08:49, zoulx1982 wrote: > when the slave computer is reset , there are two situation: > 1. the primary don't produce WAL, so walsender won't send any XLOG > I use "netstat -anp | grep postgres" to find the connection state is ESTABLISHED > > 2. the primary produce WAL and need to send to walreceiver, but there need a long time to wait timeout(about 15 minutes) > in this situation, the connection state is also ESTABLISHED Yeah, 15 minutes is the timeout in TCP. I don't remember if that's just a default that can be changed in the OS, or a requirement of the protocol. > whether we should set a reasonable timeout to avoid waiting long time? You can use tcp_keep_alive_* settings to somewhat alleviate that (see manual http://www.postgresql.org/docs/9.0/interactive/warm-standby.html#STREAMING-REPLICATION), but other than that there's currently no application-level timeout. A lingering walsender shouldn't normally cause any problems, though, it will timeout eventually. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com