Skip to content

HDDS-17511. Fix healthy datanode counts in admin checks - #11809

Open
F64116045 wants to merge 1 commit into
apache:masterfrom
F64116045:HDDS-17511
Open

F64116045 wants to merge 1 commit into
apache:masterfrom
F64116045:HDDS-17511

Conversation

@F64116045

@F64116045 F64116045 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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

Co-authored-by: Codex (GPT-6)

Subtract only healthy IN_SERVICE targets from the healthy datanode count when checking decommission and maintenance requests. Keep checking containers on STALE and DEAD targets against the required node count.

Co-authored-by: Codex (GPT-6)
@github-actions github-actions Bot added the scm label Oct 28, 2026
@F64116045
F64116045 marked this pull request as ready for review October 28, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant