Skip to content

HDDS-16199. Log skipped unhealthy containers at INFO - #11041

Open
F64116045 wants to merge 3 commits into
apache:masterfrom
F64116045:HDDS-16199
Open

HDDS-16199. Log skipped unhealthy containers at INFO#11041
F64116045 wants to merge 3 commits into
apache:masterfrom
F64116045:HDDS-16199

Conversation

@F64116045

@F64116045 F64116045 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Container Balancer excludes containers whose replication health is unsuitable for moving. The existing messages are logged at DEBUG, so they are not visible with the default INFO logging level.

This change promotes the exclusion messages to INFO for both the standard and relaxed container selection paths. It also adds unit coverage that sets the logger to INFO and verifies the message is emitted by both paths.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16199

How was this patch tested?

  • mvn -pl :hdds-server-scm -am test -Dtest=TestContainerBalancerSelectionCriteria -Dsurefire.failIfNoSpecifiedTests=false -DskipShade -DskipRecon -DskipDocs

CI: https://github.com/F64116045/ozone/actions/runs/32154722880
CI: https://github.com/F64116045/ozone/actions/runs/34578979420

replicationManager.getContainerReplicationHealth(container, replicas).getHealthState();
if (state != ContainerHealthResult.HealthState.HEALTHY) {
LOG.debug("Excluding container {} with replicas {} as its health is {}.", container, replicas, state);
LOG.info("Excluding container {} with replicas {} as its health is {}.", container, replicas, state);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather dump list of excluded containers instead of spamming logs with these messages. Also I'd consider limiting amount of entries that are getting logged to 50 or less + number of entries in exclude list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think this makes sense. I initially followed the Jira suggestion and moved the existing log to INFO, but you're right that it could get noisy.

@F64116045

Copy link
Copy Markdown
Contributor Author

Thanks @yandrey321 for the review.
Updated to log the total count and only the first 50 excluded containers once per iteration. The per-container logs remain at DEBUG.

@F64116045
F64116045 marked this pull request as ready for review August 19, 2026 00:56
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label Sep 10, 2026
# Conflicts:
#	hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java
@F64116045

Copy link
Copy Markdown
Contributor Author

@yandrey321 Would you take another look when you have time? Thanks!

@github-actions github-actions Bot removed the stale label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants