[
https://issues.apache.org/jira/browse/HDDS-17118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Siyao Meng updated HDDS-17118:
------------------------------
Description:
Generalize the S3 Gateway health endpoints (HDDS-16360) into BaseHttpServer.
Register them as internal servlets so that they need no SPNEGO.
* /health/live: 200 while the HTTP server responds.
* /health/ready: 200 once StartupProgress is complete and the service is not
stopping, 503 otherwise.
h3. Implementation notes
* New BaseHttpServer#addHealthServlets(BooleanSupplier ready), called by SCM
({{startupProgress.isComplete() && !isStopped()}}), OM
({{startupProgress.isComplete() && isRunning()}}) and the datanode
({{startupProgress.isComplete() && !isStopped()}}). Responses are only "OK",
"READY" or "NOT READY"; startup details stay on the authenticated /jmx.
* Readiness means startup is complete. For SCM that includes Raft log catch-up
and safe mode exit; OM and datanodes need SCM to be reachable. So /health/ready
must not be used as a Kubernetes readiness probe on pods behind a headless
service without publishNotReadyAddresses: true (peers would lose DNS for the
pod, and SCM would never leave safe mode). This is documented in the javadoc;
HDDS-17119 therefore only uses /health/live.
* The S3 Gateway keeps its own health servlets, which have the same paths. It
could use addHealthServlets in a follow-up.
* The servlets are not added when the HTTP server is disabled.
h3. Dependencies
*Depends on HDDS-17117 (and so on HDDS-17116, HDDS-17115 and HDDS-17107).*
HDDS-17118.001.diff applies on top of HDDS-17117.001.diff, HDDS-17116.001.diff,
HDDS-17115.001.diff and the HDDS-17107 change
(https://github.com/apache/ozone/pull/11611), in that order.
Testing: new TestBaseHttpServer#healthServlets,
TestHddsDatanodeService#testHealthEndpoints (live 200, ready 503 without SCM);
/health/ready assertions added to TestStorageContainerManager#startupProgress
(503 before and after start(), 200 after safe mode exit) and
TestOzoneManagerStartupProgress (503 before start(), 200 after); checkstyle.
The secure-mode bypass relies on HttpServer2#addInternalServlet and is not
covered by a secure test.
was:
Generalize the S3 Gateway health endpoints (HDDS-16360) into BaseHttpServer.
Register them as internal servlets so that they need no SPNEGO.
* /health/live: 200 while the HTTP server responds.
* /health/ready: 200 once StartupProgress is complete and the service is not
stopping, 503 otherwise.
> Add /health/live and /health/ready endpoints to OM, SCM and Datanode
> --------------------------------------------------------------------
>
> Key: HDDS-17118
> URL: https://issues.apache.org/jira/browse/HDDS-17118
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: server-framework
> Reporter: Siyao Meng
> Priority: Major
> Attachments: HDDS-17118.001.diff
>
>
> Generalize the S3 Gateway health endpoints (HDDS-16360) into BaseHttpServer.
> Register them as internal servlets so that they need no SPNEGO.
> * /health/live: 200 while the HTTP server responds.
> * /health/ready: 200 once StartupProgress is complete and the service is not
> stopping, 503 otherwise.
> h3. Implementation notes
> * New BaseHttpServer#addHealthServlets(BooleanSupplier ready), called by SCM
> ({{startupProgress.isComplete() && !isStopped()}}), OM
> ({{startupProgress.isComplete() && isRunning()}}) and the datanode
> ({{startupProgress.isComplete() && !isStopped()}}). Responses are only "OK",
> "READY" or "NOT READY"; startup details stay on the authenticated /jmx.
> * Readiness means startup is complete. For SCM that includes Raft log
> catch-up and safe mode exit; OM and datanodes need SCM to be reachable. So
> /health/ready must not be used as a Kubernetes readiness probe on pods behind
> a headless service without publishNotReadyAddresses: true (peers would lose
> DNS for the pod, and SCM would never leave safe mode). This is documented in
> the javadoc; HDDS-17119 therefore only uses /health/live.
> * The S3 Gateway keeps its own health servlets, which have the same paths. It
> could use addHealthServlets in a follow-up.
> * The servlets are not added when the HTTP server is disabled.
> h3. Dependencies
> *Depends on HDDS-17117 (and so on HDDS-17116, HDDS-17115 and HDDS-17107).*
> HDDS-17118.001.diff applies on top of HDDS-17117.001.diff,
> HDDS-17116.001.diff, HDDS-17115.001.diff and the HDDS-17107 change
> (https://github.com/apache/ozone/pull/11611), in that order.
> Testing: new TestBaseHttpServer#healthServlets,
> TestHddsDatanodeService#testHealthEndpoints (live 200, ready 503 without
> SCM); /health/ready assertions added to
> TestStorageContainerManager#startupProgress (503 before and after start(),
> 200 after safe mode exit) and TestOzoneManagerStartupProgress (503 before
> start(), 200 after); checkstyle. The secure-mode bypass relies on
> HttpServer2#addInternalServlet and is not covered by a secure test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]