Github user nkalmar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/549#discussion_r198407883
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
---
@@ -259,6 +259,11 @@ public QuorumServer(long sid, String addressStr)
throws ConfigException {
throw new ConfigException("Address unresolved: " +
serverParts[0] + ":" + serverParts[2]);
}
+ if(addr.getPort() == electionAddr.getPort()) {
+ throw new ConfigException(
+ "Client and election port must be different!
Please update the configuration file on server." + sid);
+ }
+
--- End diff --
Good question. Well, as what I can see it is only used for test, and it is
called programmatically, so not from reading a config. The intention here was
to make sure that ZK is not misconfigured.
So I'm open to adding it there also, just my initial thinking was it is not
necessary.
---