ChenSammi commented on code in PR #8693:
URL: https://github.com/apache/ozone/pull/8693#discussion_r2188919541
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -470,14 +471,28 @@ public BackgroundTaskResult call() {
Path diskBalancerTmpDir = null, diskBalancerDestDir = null;
long containerSize = containerData.getBytesUsed();
try {
+ // Step 1: Copy container to new Volume's tmp Dir
diskBalancerTmpDir = destVolume.getTmpDir().toPath()
.resolve(DISK_BALANCER_DIR).resolve(String.valueOf(containerId));
-
- // Copy container to new Volume's tmp Dir
ozoneContainer.getController().copyContainer(containerData,
diskBalancerTmpDir);
- // Move container directory to final place on new volume
+ // Step 2: Transition to Temp container to Temp C1-RECOVERING
Review Comment:
@Gargi-jais11 , thanks for working on this improvement.
Please add new unit tests to test
a. if the process fails at each step, necessary cleanup are executed on
disk, and in memory important container related data structure are intact, such
as containerSet should not include failed container, volume should have correct
Usedspace.
b. if process succeed, check that new container is in containerSet, and old
container is removed, also check the used size of volume.
To mock the failure, see if FaultInjector helps.
--
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]