zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randgalt <...@git.apache.org>
Subject [GitHub] zookeeper pull request #377: [ZOOKEEPER-2901] TTL Nodes don't work with Serv...
Date Thu, 28 Sep 2017 03:47:04 GMT
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/377#discussion_r141521002
  
    --- Diff: src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java ---
    @@ -84,6 +84,9 @@ public static long initializeNextSession(long id) {
             long nextSid;
             nextSid = (Time.currentElapsedTime() << 24) >>> 8;
             nextSid =  nextSid | (id <<56);
    +        if (nextSid == EphemeralType.CONTAINER_EPHEMERAL_OWNER) {
    +            ++nextSid;  // this is an unlikely edge case, but check it just in case
    --- End diff --
    
    "no longer strictly true" - actually it still is true. If `Time.currentElapsedTime()`
returns 0 and server Id is 0x80, this will happen. That's why nextSid has to be incremented
in that case.


---

Mime
View raw message