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


##########
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:
   After going through importContainer logic.
   In **ozoneContainer.getController().importContainer** we are passing two 
variables where **originalContainerData** is generated on the basis of temp 
container moved to its final destination on destVolume. So as a result of that 
since it was in RECOVERING state after atomic move so inside importContainer 
method it at the end its state is set to RECOVERING again. So we need to change 
explicity new container state to CLOSED after import.
   ```
   // Generate a new Container based on destDir which is in C1-RECOVERING state.
           File containerFile = ContainerUtils.getContainerFile(
               diskBalancerDestDir.toFile());
           if (!containerFile.exists()) {
             throw new IOException("ContainerFile for container " + containerId
             + " doesn't exists.");
           }
           ContainerData originalContainerData = ContainerDataYaml
               .readContainerFile(containerFile);
           Container newContainer = ozoneContainer.getController()
               .importContainer(originalContainerData, diskBalancerDestDir);
   ```



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