zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #447: [ZOOKEEPER-2926] Fix potential data consistency...
Date Thu, 26 Jul 2018 06:12:16 GMT
Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/447#discussion_r205340493
  
    --- Diff: src/java/main/org/apache/zookeeper/server/SessionTracker.java ---
    @@ -47,21 +47,20 @@
         long createSession(int sessionTimeout);
     
         /**
    -     * Add a global session to those being tracked.
    +     * Track the session expire, not add to ZkDb.
          * @param id sessionId
          * @param to sessionTimeout
          * @return whether the session was newly added (if false, already existed)
          */
    -    boolean addGlobalSession(long id, int to);
    +    boolean trackSession(long id, int to);
     
         /**
    -     * Add a session to those being tracked. The session is added as a local
    -     * session if they are enabled, otherwise as global.
    +     * Add the session to the under layer storage.
    --- End diff --
    
    I think the comment here is a little bit confusing. `commitSession`itself does not directly
add session to storage, it's the snapshot that does this. I think the comment should mention
that this function will add the session to the zkDB, this also maps to the `trackSession`
comment (which does not modify zkDB.). It would be great if a reader can instantly get what
`commit` means here by just reading the comment.


---

Mime
View raw message