Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 37274 invoked from network); 8 Sep 2010 20:04:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 20:04:19 -0000 Received: (qmail 15679 invoked by uid 500); 8 Sep 2010 20:04:19 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 15637 invoked by uid 500); 8 Sep 2010 20:04:19 -0000 Mailing-List: contact zookeeper-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-user@hadoop.apache.org Delivered-To: mailing list zookeeper-user@hadoop.apache.org Received: (qmail 15628 invoked by uid 99); 8 Sep 2010 20:04:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 20:04:18 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [69.147.107.20] (HELO mrout1-b.corp.re1.yahoo.com) (69.147.107.20) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 20:04:14 +0000 Received: from [10.73.135.251] (wifi-e-135-251.corp.yahoo.com [10.73.135.251]) by mrout1-b.corp.re1.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id o88K3Gv7085717 for ; Wed, 8 Sep 2010 13:03:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:content-type:content-transfer-encoding; b=EeRR01ijYtAvbXY/DtJADFlF3sHImkNRYlTHtHrHU9GebJUTIdWtUci26nV75SvX Message-ID: <4C87EBFE.2040806@yahoo-inc.com> Date: Wed, 08 Sep 2010 13:03:10 -0700 From: Benjamin Reed User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: zookeeper-user@hadoop.apache.org Subject: Re: closing session on socket close vs waiting for timeout References: <69D3016305F9084FBD2C4A0DF189BD5C16995AE120@GSCMAMP02EX.firmwide.corp.gs.com> <4C7E8754.30806@yahoo-inc.com> <4C7EADCB.7010807@apache.org> <4C8558E1.3060608@yahoo-inc.com> <69D3016305F9084FBD2C4A0DF189BD5C16995AE7C9@GSCMAMP02EX.firmwide.corp.gs.com> In-Reply-To: <69D3016305F9084FBD2C4A0DF189BD5C16995AE7C9@GSCMAMP02EX.firmwide.corp.gs.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit unfortunately, that only works on the standalone server. ben On 09/08/2010 12:52 PM, Fournier, Camille F. [Tech] wrote: > This would be the ideal solution to this problem I think. > Poking around the (3.3) code to figure out how hard it would be to implement, I figure one way to do it would be to modify the session timeout to the min session timeout and touch the connection before calling close when you get certain exceptions in NIOServerCnxn.doIO. I did this (removing the code in touch session that returns if the tickTime is greater than the expire time) and it worked (in the standalone server anyway). Interesting solution, or total hack that will not work beyond most basic test case? > > C > > (forgive lack of actual code in this email) > > -----Original Message----- > From: Ted Dunning [mailto:ted.dunning@gmail.com] > Sent: Tuesday, September 07, 2010 1:11 PM > To: zookeeper-user@hadoop.apache.org > Cc: Benjamin Reed > Subject: Re: closing session on socket close vs waiting for timeout > > This really is, just as Ben says a problem of false positives and false > negatives in detecting session > expiration. > > On the other hand, the current algorithm isn't really using all the > information available. The current algorithm is > using time since last client initiated heartbeat. The new proposal is > somewhat worse in that it proposes to use > just the boolean "has-TCP-disconnect-happened". > > Perhaps it would be better to use multiple features in order to decrease > both false positives and false negatives. > > For instance, I could imagine that we use the following features: > > - time since last client hearbeat or disconnect or reconnect > > - what was the last event? (a heartbeat or a disconnect or a reconnect) > > Then the expiration algorithm could use a relatively long time since last > heartbeat and a relatively short time since last disconnect to mark a > session as disconnected. > > Wouldn't this avoid expiration during GC and cluster partition and cause > expiration quickly after a client disconnect? > > > On Mon, Sep 6, 2010 at 11:26 PM, Patrick Hunt wrote: > > >> That's a good point, however with suitable documentation, warnings and such >> it seems like a reasonable feature to provide for those users who require >> it. Used in moderation it seems fine to me. Perhaps we also make it >> configurable at the server level for those administrators/ops who don't >> want >> to deal with it (disable the feature entirely, or only enable on particular >> servers, etc...). >> >> Patrick >> >> On Mon, Sep 6, 2010 at 2:10 PM, Benjamin Reed wrote: >> >> >>> if this mechanism were used very often, we would get a huge number of >>> session expirations when a server fails. you are trading fast error >>> detection for the ability to tolerate temporary network and server >>> >> outages. >> >>> to be honest this seems like something that in theory sounds like it will >>> work in practice, but once deployed we start getting session expirations >>> >> for >> >>> cases that we really do not want or expect. >>> >>> ben >>> >>> >>> On 09/01/2010 12:47 PM, Patrick Hunt wrote: >>> >>> >>>> Ben, in this case the session would be tied directly to the connection, >>>> we'd explicitly deny session re-establishment for this session type (so >>>> 4 would fail). Would that address your concern, others? >>>> >>>> Patrick >>>> >>>> On 09/01/2010 10:03 AM, Benjamin Reed wrote: >>>> >>>> >>>> >>>>> i'm a bit skeptical that this is going to work out properly. a server >>>>> may receive a socket reset even though the client is still alive: >>>>> >>>>> 1) client sends a request to a server >>>>> 2) client is partitioned from the server >>>>> 3) server starts trying to send response >>>>> 4) client reconnects to a different server >>>>> 5) partition heals >>>>> 6) server gets a reset from client >>>>> >>>>> at step 6 i don't think you want to delete the ephemeral nodes. >>>>> >>>>> ben >>>>> >>>>> On 08/31/2010 01:41 PM, Fournier, Camille F. [Tech] wrote: >>>>> >>>>> >>>>> >>>>>> Yes that's right. Which network issues can cause the socket to close >>>>>> without the initiating process closing the socket? In my limited >>>>>> experience in this area network issues were more prone to leave dead >>>>>> sockets open rather than vice versa so I don't know what to look out >>>>>> for. >>>>>> >>>>>> Thanks, >>>>>> Camille >>>>>> >>>>>> -----Original Message----- >>>>>> From: Dave Wright [mailto:wrightd@gmail.com] >>>>>> Sent: Tuesday, August 31, 2010 1:14 PM >>>>>> To: zookeeper-user@hadoop.apache.org >>>>>> Subject: Re: closing session on socket close vs waiting for timeout >>>>>> >>>>>> I think he's saying that if the socket closes because of a crash (i.e. >>>>>> not a >>>>>> normal zookeeper close request) then the session stays alive until the >>>>>> session timeout, which is of course true since ZK allows reconnection >>>>>> and >>>>>> resumption of the session in case of disconnect due to network issues. >>>>>> >>>>>> -Dave Wright >>>>>> >>>>>> On Tue, Aug 31, 2010 at 1:03 PM, Ted Dunning >>>>>> wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> That doesn't sound right to me. >>>>>>> >>>>>>> Is there a Zookeeper expert in the house? >>>>>>> >>>>>>> On Tue, Aug 31, 2010 at 8:58 AM, Fournier, Camille F. [Tech]< >>>>>>> Camille.Fournier@gs.com> wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> I foolishly did not investigate the ZK code closely enough and it >>>>>>>> seems >>>>>>>> that closing the socket still waits for the session timeout to >>>>>>>> remove the >>>>>>>> session. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>> >>>> >>> >>