[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900511#action_12900511
 ] 

Benjamin Reed commented on ZOOKEEPER-366:
-----------------------------------------

after discussion this on the list, we realized that we can detect a big jump in 
time change in the session expiration thread. since we expire a bucket of 
sessions each tick, if we run into the situation where we are going to expire 
more than one bucket in a row, we know we have jumped forward in time. we can 
"smooth" the jump by requiring at least a 1/2 ticktime wait between each 
bucket. 

> Session timeout detection can go wrong if the leader system time changes
> ------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-366
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-366
>             Project: Zookeeper
>          Issue Type: Bug
>            Reporter: Benjamin Reed
>
> the leader tracks session expirations by calculating when a session will 
> timeout and then periodically checking to see what needs to be timed out 
> based on the current time. this works great as long as the leaders clock 
> progresses at a steady pace. the problem comes when there are big (session 
> size) changes in clock, by ntp for example. if time gets adjusted forward, 
> all the sessions could timeout immediately. if time goes backward sessions 
> that should timeout may take a lot longer to actually expire.
> this is really just a leader issue. the easiest way to deal with this is to 
> have the leader relinquish leadership if it detects a big jump forward in 
> time. when a new leader gets elected, it will recalculate timeouts of active 
> sessions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to