hanishakoneru commented on a change in pull request #1622:
URL: https://github.com/apache/ozone/pull/1622#discussion_r529868189
##########
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:
Bharat, in this scenario where the OM state was not reloaded with new
checkpoint, it would be better to keep the backup also in place. Just in case
the OM needs to be manually reversed back to old state.
----------------------------------------------------------------
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]