janhoy 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_r401835111
 
 

 ##########
 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:
   I confused server state with role. Seems like even in dynamic reconfig mode, 
the servers report state leader/follower, and can also have a role participant 
or observer.
   
   The only thing I'm not 100% sure about is whether `zk_server_state` can have 
the value `observer` when not in dynamic reconfig mode, cause observer feature 
pre-dates dynamic reconfig I think. I put it in there as an OR check and count 
it as follower for now, but it might never get that value.
   
   I do not generate any WARN/ERROR messages in UI based on number of observers 
vs participants, as it is allowed to scale down to 1 participant if you like. 
Not sure what happens if you have 2 participants, is that still "A Bad Thing™"? 
Today we warn if there is an even number of leader/follower, but our code does 
not yet know about observers. Perhaps we should count participants and WARN if 
they are even in number, or will ZK handle it gracefully so we don't need to 
warn?

----------------------------------------------------------------
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