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



##########
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:
       hello,I think it should be check in the 
DownloadAndImportReplicator,because of  the source datanode will through 
outputstream to the tar,if tar is null,the task status should be set failed,the 
tar size check in TarContainerPacker I think is not useful.




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