Skip to content

HDDS-15257. [DiskBalancer] Add CLOSING state to the "not movable" check#10254

Merged
ChenSammi merged 1 commit into
apache:masterfrom
Gargi-jais11:HDDS-15257
May 13, 2026
Merged

HDDS-15257. [DiskBalancer] Add CLOSING state to the "not movable" check#10254
ChenSammi merged 1 commit into
apache:masterfrom
Gargi-jais11:HDDS-15257

Conversation

@Gargi-jais11
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

isOpenToWriteState(state) only returns true for OPEN and RECOVERING:

  public static boolean isOpenToWriteState(State state) {
    return state == State.OPEN || state == State.RECOVERING;
  } 

CLOSING is not covered. So when this validation in DiskBalancerConfiguration runs, it only blocks OPEN, RECOVERING, and DELETED. A user who configures movableContainerStates = CLOSING would not get an error — the config would silently allow DiskBalancer to try to move containers in CLOSING state.

Fix:

if (HddsUtils.isOpenToWriteState(state) || state == State.CLOSING || state == State.DELETED) {
    throw new IllegalArgumentException("State " + name + " is not movable.");
} 
 

What is the link to the Apache JIRA

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

How was this patch tested?

Updated unit test and tested manually.

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review May 13, 2026 08:28
@Gargi-jais11 Gargi-jais11 requested a review from ChenSammi May 13, 2026 08:28
Copy link
Copy Markdown
Contributor

@ChenSammi ChenSammi left a comment

Choose a reason for hiding this comment

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

Thanks @Gargi-jais11 .

@ChenSammi ChenSammi merged commit 8c89c58 into apache:master May 13, 2026
78 of 79 checks passed
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