janhoy commented on a change in pull request #73:
URL: https://github.com/apache/solr/pull/73#discussion_r627365842



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java
##########
@@ -48,6 +48,49 @@
   private final ZkNodeProps message;
   private final String collection; // maybe null
 
+  /** Shard / collection health state. */
+  public enum Health {
+    /** All replicas up, leader exists. */
+    GREEN,
+    /** Some replicas down, leader exists. */
+    YELLOW,
+    /** Many replicas down, leader exists. */
+    ORANGE,
+    /** No leader or most replicas down. */

Review comment:
       With the latest changes, this will read "No leader or all replicas 
down". Also, the ORANGE level can be written as "Majority of replicas down, 
leader exists"?

##########
File path: solr/solr-ref-guide/src/cluster-node-management.adoc
##########
@@ -26,6 +26,24 @@ These API commands work with a SolrCloud cluster at the 
entire cluster level, or
 
 Fetch the cluster status including collections, shards, replicas, 
configuration name as well as collection aliases and cluster properties.
 
+Additionally, this command reports a `health` status of each collection and 
shard, in
+order to make it easier to monitor the operational state of the collections. 
The
+following health state values are defined, ordered from the best to worst, 
based on
+the percentage of active replicas (`active`):
+
+`GREEN`::
+`active == 100%`, all replicas are active and there's a shard leader.
+`YELLOW`::
+`100% > active > 50%`, AND there's a shard leader.
+`ORANGE`::
+`50% >= active > 1%`, AND there's a shard leader.

Review comment:
       0.1 which is the logic implemented in code is 10%, not 1%. But if we 
change to 0.0 as suggested above, then the ORANGE rule will be `50% >= active > 
0%`, and the RED rule will be `No active replicas OR there's no shard leader`.

##########
File path: solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java
##########
@@ -48,6 +48,49 @@
   private final ZkNodeProps message;
   private final String collection; // maybe null
 
+  /** Shard / collection health state. */
+  public enum Health {
+    /** All replicas up, leader exists. */
+    GREEN,
+    /** Some replicas down, leader exists. */
+    YELLOW,
+    /** Many replicas down, leader exists. */
+    ORANGE,
+    /** No leader or most replicas down. */
+    RED;
+
+    public static final float ORANGE_LEVEL = 0.5f;
+    public static final float RED_LEVEL = 0.1f;

Review comment:
       RED_LEVEL could be 0.0, cause we require > RED_LEVEL. 
   Then, if someone have 20 replicas, you'll be ORANGE instead of RED when 1 
replica is alive.




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



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

Reply via email to