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 2022/04/14 04:49:52 UTC

[GitHub] [ozone] Xushaohong commented on a diff in pull request #3268: HDDS-6547. om snapshot failed file not deleted.

Xushaohong commented on code in PR #3268:
URL: https://github.com/apache/ozone/pull/3268#discussion_r850080090


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OzoneManagerSnapshotProvider.java:
##########
@@ -135,6 +135,12 @@ public DBCheckpoint getOzoneManagerDBSnapshot(String leaderOMNodeID)
 
       try (InputStream inputStream = httpURLConnection.getInputStream()) {
         FileUtils.copyInputStreamToFile(inputStream, targetFile);
+      } catch (IOException ex) {
+        boolean deleted = FileUtils.deleteQuietly(targetFile);
+        LOG.error("OM snapshot {} cannot be downloaded.", targetFile, ex);
+        if (!deleted) {
+          LOG.error("OM snapshot {} cannot be deleted", targetFile);

Review Comment:
   > The log messages "OM snapshot cannot be deleted" could be confusing. Can we change the 2nd message to indicate that the "failed snapshot download" could not be deleted?
   
   Make sense. Thx for the suggestion. I've updated PR. @hanishakoneru 



-- 
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: issues-unsubscribe@ozone.apache.org

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