dombizita commented on code in PR #6987:
URL: https://github.com/apache/ozone/pull/6987#discussion_r1695100286


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -260,6 +263,18 @@ public void start() {
       omMetadataManager.start(configuration);
     } catch (IOException ioEx) {
       LOG.error("Error starting Recon OM Metadata Manager.", ioEx);
+    } catch (RuntimeException runtimeException) {
+      LOG.warn("Unexpected runtime error starting Recon OM Metadata Manager.", 
runtimeException);
+      LOG.warn("Trying to delete existing recon OM snapshot DB and fetch new 
one.");
+      metrics.incrNumSnapshotRequests();
+      LOG.info("Fetching full snapshot from Ozone Manager");
+      // Update local Recon OM DB to new snapshot.
+      try {
+        boolean success = updateReconOmDBWithNewSnapshot();
+        LOG.info("Fetched full new snapshot from Ozone Manager: {}", success);

Review Comment:
   I don't think a simple if-else increases complexity in this case. I thought 
of this because when someone will debug Recon and look the logs, they might 
slip on/misunderstand this log message and only see that Recon already "fetched 
full new snapshot".
   ```
   Fetched full new snapshot from Ozone Manager: false
   ``` 
   I don't see this kind of logs in Ozone anywhere else, where you state 
something and a simple true/false in the end of the log determines the success 
of the statement. 
   Also when you are searching in logs usually you are searching for 
"success"/"fail", not for "true"/"false". Maybe we should also consider 
changing the log level based on the success of the snapshot fetch. 
   Let me know what you think of these ideas. 



-- 
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: [email protected]

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