Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/546#discussion_r197496922
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
---
@@ -2069,4 +2073,9 @@ public QuorumCnxManager createCnxnManager() {
this.quorumCnxnThreadsSize,
this.isQuorumSaslAuthEnabled());
}
+
+ boolean isLeader(long id) {
+ Vote vote = getCurrentVote();
+ return vote != null && id == vote.getId();
--- End diff --
@anmolnar
Do I have to check in the current view?
Is this about temporary leader election phase? I don't know the code very
well
can you please give an hint about this new test?
Do I have to simply test the check I am adding? Like a basic unit test with
mockito?
---