zookeeper-dev mailing list archives

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

    https://github.com/apache/zookeeper/pull/447#discussion_r161296493
  
    --- Diff: src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java ---
    @@ -579,13 +579,8 @@ protected void pRequest2Txn(int type, long zxid, Request request,
                     int to = request.request.getInt();
                     request.setTxn(new CreateSessionTxn(to));
                     request.request.rewind();
    -                if (request.isLocalSession()) {
    -                    // This will add to local session tracker if it is enabled
    -                    zks.sessionTracker.addSession(request.sessionId, to);
    -                } else {
    -                    // Explicitly add to global session if the flag is not set
    -                    zks.sessionTracker.addGlobalSession(request.sessionId, to);
    -                }
    +                // only add the global session tracker but not to ZKDb
    +                zks.sessionTracker.addGlobalSession(request.sessionId, to);
    --- End diff --
    
    On LeaderSessionTracker, we need to differentiate add local session or global session,
but since we only call createSession when add local session, I think I can simplify the interface
more by removing addGlobalSession and rename addSession to trackSession.


---

Mime
View raw message