zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfirlevari <...@git.apache.org>
Subject [GitHub] zookeeper pull request #411: ZOOKEEPER-2684 Fix a crashing bug in the mixed ...
Date Tue, 31 Oct 2017 14:36:08 GMT
Github user kfirlevari commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/411#discussion_r148014638
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/CommitProcessor.java ---
    @@ -255,24 +255,23 @@ public void run() {
                             // If session queue != null, then it is also not empty.
                             Request topPending = sessionQueue.poll();
                             if (request.cxid != topPending.cxid) {
    -                            LOG.error(
    -                                    "Got cxid 0x"
    -                                            + Long.toHexString(request.cxid)
    -                                            + " expected 0x" + Long.toHexString(
    -                                                    topPending.cxid)
    -                                    + " for client session id "
    -                                    + Long.toHexString(request.sessionId));
    -                            throw new IOException("Error: unexpected cxid for"
    -                                    + "client session");
    +                            // we can get commit requests that are not at the queue head
after
    +                            // a session moved (see ZOOKEEPER-2684). We will just pass
the
    +                            // commit to the next processor and put the pending back
with
    +                            // a warning, we should not see this often under normal load
    +                            LOG.warn("Got request " + request +
    +                                    " but we are expecting request " + topPending);
    +                            sessionQueue.addFirst(topPending);
    +                        } else {
    +                            /*
    +                             * We want to send our version of the request. the
    +                             * pointer to the connection in the request
    +                             */
    +                            topPending.setHdr(request.getHdr());
    --- End diff --
    
    I added an explanation, let me know if you meant something more specific. 


---

Mime
View raw message