diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java index 9b12600f34c..7f10e2457e0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java @@ -680,9 +680,10 @@ synchronized void connectOne(long sid){ if (connectOne(sid, lastCommittedView.get(sid).electionAddr)) return; } - if (lastSeenQV != null && lastProposedView.containsKey(sid) - && (!knownId || (lastProposedView.get(sid).electionAddr != - lastCommittedView.get(sid).electionAddr))) { + if (lastSeenQV != null + && lastProposedView.containsKey(sid) + && (!knownId + || !lastProposedView.get(sid).electionAddr.equals(lastCommittedView.get(sid).electionAddr))) { knownId = true; if (connectOne(sid, lastProposedView.get(sid).electionAddr)) return;