ptlrs commented on code in PR #7934:
URL: https://github.com/apache/ozone/pull/7934#discussion_r1978589885
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/TarContainerPacker.java:
##########
@@ -95,9 +101,19 @@ public byte[]
unpackContainerData(Container<KeyValueContainerData> container,
Files.createDirectories(destContainerDir);
}
if (FileUtils.isEmptyDirectory(destContainerDir.toFile())) {
+ // Before the atomic move, the destination dir is empty and doesn't have
a metadata directory.
+ // Writing the .container file will fail as the metadata dir doesn't
exist
+ Path containerMetadataPath =
Paths.get(container.getContainerData().getMetadataPath());
Review Comment:
Hi @sumitagrawl. I didn't quite follow the need for this change.
If we update the state before step (3), wouldn't we have already performed
the atomic move by then?
Also, is there any difference between updating the container file via
`updateContainerFile()` or by calling `container.update()`?
--
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]