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 066ea9fcd79..64673f5b2c8 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 @@ -722,9 +722,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; LOG.debug("Server {} knows {} already, it is in the lastProposedView", self.getId(), sid); if (connectOne(sid, lastProposedView.get(sid).electionAddr))