You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/04 06:50:22 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #1986: HDDS-4873. Re-replication failure throws NPE

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



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java
##########
@@ -109,23 +109,26 @@ public void replicate(ReplicationTask task) {
     CompletableFuture<Path> tempTarFile = downloader
         .getContainerDataFromReplicas(containerID,
             sourceDatanodes);
-
-    try {
-      //wait for the download. This thread pool is limiting the paralell
-      //downloads, so it's ok to block here and wait for the full download.
-      Path path = tempTarFile.get();
-      long bytes = Files.size(path);
-
-      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);
-    } catch (Exception e) {
-      LOG.error("Container {} replication was unsuccessful.", containerID, e);
+    if (tempTarFile == null) {
       task.setStatus(Status.FAILED);
+    }else{

Review comment:
       ```suggestion
       } else {
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org