Skip to content

Conversation

@Gargi-jais11
Copy link
Contributor

What changes were proposed in this pull request?

The container choose and container actual move is two procedures. There is chance that container state is changed after container is selected, for example, container is moved to deleted state. So need to double check the container state again before acquire the container lock to start the move process.

Container should be moved only if they are in CLOSED or QUASI_CLOSED state.

What is the link to the Apache JIRA

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

How was this patch tested?

Added new unit test in TestDiskBalancerTask

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review December 31, 2025 07:26
// Container state may have changed after selection.
// Only CLOSED and QUASI_CLOSED containers can be moved.
State containerState = container.getContainerData().getState();
if (containerState != State.CLOSED && containerState != State.QUASI_CLOSED) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In DefaultContainerChoosingPolicy#chooseContainer, only CLOSED state container is selected, QUASI_CLOSED container is used in test cases.

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