Gargi-jais11 opened a new pull request, #10254:
URL: https://github.com/apache/ozone/pull/10254
## 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.
--
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]