pallavithegod commented on code in PR #3358:
URL: https://github.com/apache/hugegraph/pull/3358#discussion_r4316700599


##########
hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/StoreAPI.java:
##########
@@ -388,22 +388,20 @@ class StoreStatistics {
      * This interface is used to check the health status of the service by 
accessing the /health
      * path via a GET request.
      * <p>
-     * This is a liveness signal only: it answers 200 as soon as the REST 
listener is up and
-     * does not consult the raft state. Use {@link #checkReady()} to find out 
whether this PD
-     * can actually serve.
+     * This liveness signal answers 503 for a fatal raft error or a stopped 
state machine.
+     * Elections and temporary quorum loss remain healthy. Use {@link 
#checkReady()} to find
+     * out whether this PD can actually serve.
      *
      * @return Returns a string indicating the service's health status. 
Typically, an empty
      * string indicates the service is healthy.
      */
-    // TODO: answer non-200 when the raft state machine is in STATE_ERROR (a 
failed snapshot) or
-    // the KV store never opened (a held RocksDB LOCK): both leave this PD 
unable to recover while
-    // /health stays 200 forever. The Helm chart (helm/hugegraph) derives a 
single PD's startup
-    // and liveness probes to /v1/ready for this reason; drop that derivation 
once this reports it.
-    // https://github.com/apache/hugegraph/issues/3222
-    // https://github.com/apache/hugegraph/issues/3226
     @GetMapping(value = "/health", produces = MediaType.TEXT_PLAIN_VALUE)
-    public Serializable checkHealthy() {
-        return "";
+    public ResponseEntity<String> checkHealthy() {

Review Comment:
   Restored the #3226 pointer above checkHealthy and documented that the probe 
reads only Raft state in e7e66661a. Following the startup-path clarification, 
the API reference says metadata-open failures propagate through startup and 
leaves bounded LOCK retry tracked separately.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to