zookeeper-dev mailing list archives

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

    https://github.com/apache/zookeeper/pull/447#discussion_r160972325
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java ---
    @@ -1187,13 +1187,8 @@ private ProcessTxnResult processTxn(Request request, TxnHeader
hdr,
             if (opCode == OpCode.createSession) {
                 if (hdr != null && txn instanceof CreateSessionTxn) {
                     CreateSessionTxn cst = (CreateSessionTxn) txn;
    -                sessionTracker.addGlobalSession(sessionId, cst.getTimeOut());
    -            } else if (request != null && request.isLocalSession()) {
    -                request.request.rewind();
    -                int timeout = request.request.getInt();
    -                request.request.rewind();
    -                sessionTracker.addSession(request.sessionId, timeout);
    -            } else {
    +                sessionTracker.commitSession(sessionId, cst.getTimeOut());
    +            } else if (request == null || !request.isLocalSession()) {
    --- End diff --
    
    Do you need this check here?
    Basically you removed the part of requesting localSession creation, because it has already
happened in PrepRequestProcessor and it's safe to leave the default 'else' handler as it was.


---

Mime
View raw message