Gargi-jais11 commented on code in PR #10109:
URL: https://github.com/apache/ozone/pull/10109#discussion_r3151966968


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -484,23 +484,23 @@ public BackgroundTaskResult call() {
         return BackgroundTaskResult.EmptyTaskResult.newResult();
       }
 
-      // Double check container state before acquiring lock to start move 
process.
-      // Container state may have changed after selection. Only CLOSED 
containers can be moved.
-      // QUASI_CLOSED is allowed when test mode is enabled, this is done to 
test in production
-      // these containers are rejected.
-      State containerState = container.getContainerData().getState();
-      boolean isTestMode = DefaultContainerChoosingPolicy.isTest();
-      if (containerState != State.CLOSED && !(isTestMode && containerState == 
State.QUASI_CLOSED)) {
-        LOG.warn("Container {} is in {} state, skipping move process. Only 
CLOSED containers can be moved.",
-            containerId, containerState);
-        postCall(false, startTime);
-        return BackgroundTaskResult.EmptyTaskResult.newResult();
-      }
-
       // hold read lock on the container first, to avoid other threads to 
update the container state,
       // such as block deletion.
       container.readLock();
       try {
+        // Double check container state after acquiring lock to start move 
process.
+        // Container state may have changed after selection. Only CLOSED 
containers can be moved.
+        // QUASI_CLOSED is allowed when test mode is enabled, this is done to 
test in production
+        // these containers are rejected.
+        State containerState = container.getContainerData().getState();
+        boolean isTestMode = DefaultContainerChoosingPolicy.isTest();
+        if (containerState != State.CLOSED && !(isTestMode && containerState 
== State.QUASI_CLOSED)) {

Review Comment:
   Updated .



-- 
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]

Reply via email to