bharatviswa504 commented on a change in pull request #1622:
URL: https://github.com/apache/ozone/pull/1622#discussion_r529869628



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3324,8 +3324,16 @@ TermIndex installCheckpoint(String leaderId, Path 
checkpointLocation,
       omRatisServer.getOmStateMachine().unpause(lastAppliedIndex, term);
       LOG.info("Reloaded OM state with Term: {} and Index: {}", term,
           lastAppliedIndex);
-    } catch (IOException ex) {
+    } catch (Exception ex) {
       String errorMsg = "Failed to reload OM state and instantiate services.";
+      // Delete the backup DB if exists and then terminate OM.
+      try {
+        if (dbBackup != null) {
+          FileUtils.deleteFully(dbBackup);
+        }
+      } catch (Exception e) {
+        LOG.error("Failed to delete the backup of the original DB {}", 
dbBackup);
+      }

Review comment:
       Ya thought of it, but my thought process here is when OM restarts it 
will get a new install Snapshot and try again. Because when OM it starts, 
anyway it cannot use this backup path, until some one manual replacing.
   
   But I think to be on safer side, will remove this code for now.




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