sodonnel commented on code in PR #4887:
URL: https://github.com/apache/ozone/pull/4887#discussion_r1469493501
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -367,7 +393,88 @@ private class DiskBalancerTask implements BackgroundTask {
@Override
public BackgroundTaskResult call() {
- // TODO: Details of handling tasks
+ long containerId = containerData.getContainerID();
+ boolean destVolumeIncreased = false;
+ Path diskBalancerTmpDir = null, diskBalancerDestDir = null;
+ long containerSize = containerData.getBytesUsed();
+ try {
+ diskBalancerTmpDir = destVolume.getTmpPath()
+ .resolve(DISK_BALANCER_DIR).resolve(String.valueOf(containerId));
+
+ // Copy container to new Volume's tmp Dir
+ ozoneContainer.getController().copyContainer(containerData,
Review Comment:
Is there somewhere else in the code that blocks operations against the
container while the export / import is happening? Eg, if a we run
`copyContainer`. After that completes a delete block is processed, deleting the
block from the original copy, but not the new copy. Then we continue and at the
end we have a block in the moved container that should have been removed. I
think each of these operations on the container (copy, export, import, etc)
lock the container instance but it feels like we need something to lock across
the entire move cycle, while also allowing reads to continue.
--
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]