adoroszlai commented on a change in pull request #2196:
URL: https://github.com/apache/ozone/pull/2196#discussion_r629254189



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java
##########
@@ -121,10 +121,17 @@ public void replicate(ReplicationTask task) {
         LOG.info("Container {} is downloaded with size {}, starting to 
import.",
                 containerID, bytes);
         task.setTransferredBytes(bytes);
-
-        importContainer(containerID, path);
-        LOG.info("Container {} is replicated successfully", containerID);
-        task.setStatus(Status.DONE);
+        // if tar is null, the tar size is 45 bytes
+        if (bytes <= 45) {
+          task.setStatus(Status.FAILED);
+          LOG.warn("Container {} is downloaded with size {}, " +
+              "if size less than 45 bytes the tar file is null",
+              containerID, bytes);

Review comment:
       Please consider the case if someone wanted to introduce a new 
implementation of `ContainerPacker`, eg. based on zip.  This check would not 
make sense, or at least would need different number of minimum bytes, for the 
other implementation.




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

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