You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Kevin Burton <bu...@spinn3r.com> on 2009/01/07 05:26:58 UTC

Does session expiration only happen during total ensemble failure or network split?

>From what I can tell, a session will only expire if it can't communicate
with the ensemble due to the entire servers failing or the network splitting
preventing a ZK node from seeing the servers.
Correct?

Then in this case, an application should in theory only care about session
expiration and ZK internal errors (protocol errors, etc).

Kevin

-- 
Founder/CEO Spinn3r.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com

Re: Does session expiration only happen during total ensemble failure or network split?

Posted by Kevin Burton <bu...@spinn3r.com>.
>
>  the case you mention, the session is not really expired unless the quorum
> decides to expire it. So the client assuming that the session expired would
> be wrong to say. It is possible that as soon as you bring up the servers,
> the client reconnects with the same session and the session is still valid.
>
> Why would you want the session to expire if all the servers are down (which
> should not happen unless you kill all the nodes or the datacenter is down)
> ?
>

Because in my application a temporary node disconnect is reasonable.

I'm only watching for the value of a node to change to stop/start/restart a
set of daemons.

I a server is rebooted I don't care.  I DO care if I have a hemisphere split
or a severe error and would want to act on it..

... so a session expiration has to be voted on.  Interesting.  I guess
that's another issue I have to keep track of....

The rope is tightening around my neck :)

Kevin

-- 
Founder/CEO Spinn3r.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com

Re: Does session expiration only happen during total ensemble failure or network split?

Posted by Patrick Hunt <ph...@apache.org>.
Mahadev Konar wrote:
> Why would you want the session to expire if all the servers are down (which
> should not happen unless you kill all the nodes or the datacenter is down) ?

A more likely case is that the client port on the switch dies and the 
client is partitioned from the servers...

Patrick

> 
> mahadev
> 
> 
> On 1/7/09 12:39 PM, "Kevin Burton" <bu...@spinn3r.com> wrote:
> 
>>> The ZK ensemble leader expires the client session if it doesn't hear from
>>> the client w/in the timeout specified by the client when the session was
>>> established.
>>>
>>> A client will disconnect from a server in the ensemble and attempt
>>> reconnect to another server in the ensemble if it doesn't hear from the
>>> server w/in 2/3 of the specified session timeout.
>>>
>> OK... I got that part.  The issue I'm running into now though is that my
>> sessions aren't actually timing out when I shutdown all servers in an
>> ensemble.
>>
>> One solution/hack would be to record how long you've been disconnected and
>> assume that your session has been expired.
>>
>> Kevin
> 

Re: Does session expiration only happen during total ensemble failure or network split?

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
Kevin,
 the case you mention, the session is not really expired unless the quorum
decides to expire it. So the client assuming that the session expired would
be wrong to say. It is possible that as soon as you bring up the servers,
the client reconnects with the same session and the session is still valid.

Why would you want the session to expire if all the servers are down (which
should not happen unless you kill all the nodes or the datacenter is down) ?



mahadev


On 1/7/09 12:39 PM, "Kevin Burton" <bu...@spinn3r.com> wrote:

>> 
>> The ZK ensemble leader expires the client session if it doesn't hear from
>> the client w/in the timeout specified by the client when the session was
>> established.
>> 
>> A client will disconnect from a server in the ensemble and attempt
>> reconnect to another server in the ensemble if it doesn't hear from the
>> server w/in 2/3 of the specified session timeout.
>> 
> 
> OK... I got that part.  The issue I'm running into now though is that my
> sessions aren't actually timing out when I shutdown all servers in an
> ensemble.
> 
> One solution/hack would be to record how long you've been disconnected and
> assume that your session has been expired.
> 
> Kevin


Re: Does session expiration only happen during total ensemble failure or network split?

Posted by Kevin Burton <bu...@spinn3r.com>.
>
> The ZK ensemble leader expires the client session if it doesn't hear from
> the client w/in the timeout specified by the client when the session was
> established.
>
> A client will disconnect from a server in the ensemble and attempt
> reconnect to another server in the ensemble if it doesn't hear from the
> server w/in 2/3 of the specified session timeout.
>

OK... I got that part.  The issue I'm running into now though is that my
sessions aren't actually timing out when I shutdown all servers in an
ensemble.

One solution/hack would be to record how long you've been disconnected and
assume that your session has been expired.

Kevin

-- 
Founder/CEO Spinn3r.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com

Re: Does session expiration only happen during total ensemble failure or network split?

Posted by Patrick Hunt <ph...@apache.org>.
Kevin Burton wrote:
> From what I can tell, a session will only expire if it can't communicate
> with the ensemble due to the entire servers failing or the network splitting
> preventing a ZK node from seeing the servers.
> Correct?

The ZK ensemble leader expires the client session if it doesn't hear 
from the client w/in the timeout specified by the client when the 
session was established.

A client will disconnect from a server in the ensemble and attempt 
reconnect to another server in the ensemble if it doesn't hear from the 
server w/in 2/3 of the specified session timeout.

> Then in this case, an application should in theory only care about session
> expiration and ZK internal errors (protocol errors, etc).

In general this may be true, but not in all cases.

Patrick