zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #1052: ZOOKEEPER-3502:improve the server command: zabstate to have a better observation on the process of leader election
Date Sun, 11 Aug 2019 17:29:55 GMT
enixon commented on a change in pull request #1052: ZOOKEEPER-3502:improve the server command:
zabstate to have a better observation on the process of leader election
URL: https://github.com/apache/zookeeper/pull/1052#discussion_r312747813
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
 ##########
 @@ -743,7 +744,14 @@ public CommandResponse run(ZooKeeperServer zkServer, Map<String,
String> kwargs)
                                 && voter.addr.equals(peer.getQuorumAddress())
                                 && voter.electionAddr.equals(peer.getElectionAddress())
                 );
+                response.put("myid", zkServer.getConf().getServerId());
+                response.put("is_leader", zkServer instanceof LeaderZooKeeperServer);
+                response.put("endpoint", peer.getElectionAddress().toString().split(":")[0]+
":" + peer.getClientPort());
 
 Review comment:
   I would council you to omit or refactor "endpoint". The client address can be configured
separately from the election address so this may be inaccurate and if the server is using
the secure client port only then the address/port combination here also will not respond.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message