HoustonPutman commented on a change in pull request #1392: SOLR-14371 Zk 
StatusHandler should know about dynamic zk config
URL: https://github.com/apache/lucene-solr/pull/1392#discussion_r401042663
 
 

 ##########
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/ZookeeperStatusHandler.java
 ##########
 @@ -108,27 +128,30 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
         if ("true".equals(String.valueOf(stat.get("ok")))) {
           numOk++;
         }
-        String state = String.valueOf(stat.get("zk_server_state"));
+        String state = zk.role != null ? zk.role : 
String.valueOf(stat.get("zk_server_state"));
         if ("follower".equals(state)) {
           followers++;
         } else if ("leader".equals(state)) {
           leaders++;
           reportedFollowers = 
Integer.parseInt(String.valueOf(stat.get("zk_followers")));
         } else if ("standalone".equals(state)) {
           standalone++;
+        } else if ("participant".equals(state)) {
+          // NOCOMMIT: What does participant mean vs leader or follower?
 
 Review comment:
   Looking at the docs here 
https://zookeeper.apache.org/doc/r3.5.7/zookeeperReconfig.html, in the 
"Specifying the client port" section, it looks like the role of the zk instance 
is either observer or participant (where participant is the default). 
Participant isn't a new thing, just a name for a regular member of the ensemble 
(not an observer).
   
   This state check change may be making everything a "participant" as that's 
the default role. Maybe keep the original state logic, but add in an additional 
check in the beginning to see if the role is observer?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to