HDDS-15667. containerbalancer status: show stop reason and iteration details after stop#10681
Draft
sreejasahithi wants to merge 3 commits into
Draft
HDDS-15667. containerbalancer status: show stop reason and iteration details after stop#10681sreejasahithi wants to merge 3 commits into
containerbalancer status: show stop reason and iteration details after stop#10681sreejasahithi wants to merge 3 commits into
Conversation
…and iteration details (of last and history) after stop
containerbalancer status: show stop reason and iteration details after stop
ArafatKhan2198
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch @sreejasahithi
Some comments for you
rakeshadr
reviewed
Jul 8, 2026
rakeshadr
left a comment
Contributor
There was a problem hiding this comment.
Thanks @sreejasahithi for working on this. Added a few comments, please go thru it.
| LocalDateTime dateTime = | ||
| LocalDateTime.ofInstant(startedAtInstant, ZoneId.systemDefault()); | ||
| System.out.println("ContainerBalancer is Running."); | ||
| } else if (response.hasContainerBalancerStatusInfo()) { |
Contributor
There was a problem hiding this comment.
Can we think of adding explicit state(enum ContainerBalancerRunState) instead of overloading boolean. If this requires more code change, testing etc then please raise another sub-task(sub-jira) and improve the code.
enum ContainerBalancerRunState {
NOT_STARTED = 0;
RUNNING = 1;
STOPPING = 2;
STOPPED = 3;
}
optional ContainerBalancerRunState runState = 6;
Then CLI:
switch (balancerStatusInfo.getRunState()) {
case RUNNING:
System.out.println("ContainerBalancer is Running.");
break;
case STOPPING:
System.out.println("ContainerBalancer is Stopping.");
break;
case STOPPED:
System.out.println("ContainerBalancer is Not Running.");
break;
default:
System.out.println("ContainerBalancer is Not Running.");
}
Contributor
Author
There was a problem hiding this comment.
Agree, will keep this for a follow up jira. and keep the current PR focused on post stop status.
…ason and made minor updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Currently, when Container Balancer is stopped,
ozone admin containerbalancer statusonly reports: "ContainerBalancer is Not Running."It would be helpful if after stop, status shows the last known run state:
What is the link to the Apache JIRA
HDDS-15667
How was this patch tested?
Tested manually in docker cluster and added test cases.
Sample runs:
Green CI : https://github.com/sreejasahithi/ozone/actions/runs/28775666320