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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -507,13 +524,21 @@ public BackgroundTaskResult call() {
             .incrementUsedSpace(containerSize);
         destVolumeIncreased = true;
 
-        // Update container for containerID
+        // Step 4: New Container state transition, C1-RECOVERING -> C1-CLOSING
+        newContainer.getContainerData().setState(

Review Comment:
   So instead of above code it should be changed to something like this :
   ```
   Container newContainer = ozoneContainer.getController()
               .importContainer(containerData, diskBalancerDestDir);
   ```
   and other parts should be removed because if we pass below 
**originalContainerData** which is in turn containerData created from 
**diskBalancerDestDir** then it will end up leaving the newContainer created as 
RECOVERING state only.
   ```
   // Import the new container.
           // The import will load the container with its on-disk state, which 
is RECOVERING.
           Container newContainer = ozoneContainer.getController()
               .importContainer(containerData, diskBalancerDestDir);
           newContainer.getContainerData().getVolume()
               .incrementUsedSpace(containerSize);
           destVolumeIncreased = true;
   
           // The import process loaded the temporary RECOVERING state from 
disk.
           // Now, restore the original state and persist it to the .container 
file.
           newContainer.getContainerData().setState(containerData.getState());
           
newContainer.update(newContainer.getContainerData().getMetadata(),true);
   
   ```
   Does this sound relevant to you?



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to