F64116045 opened a new pull request, #11809:
URL: https://github.com/apache/ozone/pull/11809

   ## What changes were proposed in this pull request?
   
   Before accepting a decommission or maintenance request, SCM checks whether 
enough healthy datanodes will remain.
   It subtracts all `IN_SERVICE` targets, including `STALE` and `DEAD` targets 
that weren't included in the healthy count.
   
   For example, with three healthy datanodes and one `STALE` target, the check 
calculates 3 - 1 = 2. 
   If the target holds a container requiring three replicas, the request is 
rejected even though all three healthy datanodes remain available.
   
   This PR changes both checks to subtract only targets that are `IN_SERVICE` 
and `HEALTHY`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17511
   
   ## How was this patch tested?
   
   Added new unit tests:
   each test uses a `STALE `or `DEAD` target. It checks that the request is 
rejected with too few healthy datanodes, adds one healthy datanode to meet the 
requirement, then checks that the same request is accepted.
   
   | Request | Healthy datanodes | Minimum required | Before | After |
   | --- | --- | --- | --- | --- |
   | Decommission | 2 | 3 | Rejected | Rejected |
   | Decommission | 3 | 3 | Rejected | Accepted |
   | Maintenance | 1 | 2 | Rejected | Rejected |
   | Maintenance | 2 | 2 | Rejected | Accepted |
   
   CI: https://github.com/F64116045/ozone/actions/runs/40608672114


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