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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -260,6 +263,22 @@ 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();
+        if (success) {
+          LOG.info("Successfully fetched a full snapshot from Ozone Manager");
+        } else {
+          LOG.error("Failed fetching a full snapshot from Ozone Manager");
+        }
+      } catch (IOException e) {
+        throw new RuntimeException(e);

Review Comment:
   > Question: Why do we want to mask `IOException` and send a 
`RuntimeException`?
   
   Here this is a special corner case we would like to handle, so we know that 
when Recon OM DB snapshot was getting corrupted for unknown failures 
(`RuntimeException`) and `OMMetaManager` service was failing to start with 
`RuntimeException` thrown, then we would like to handle by falling back to full 
snapshot and if full snapshot fetch also failed due to any exception including 
`IOException`, we know that we are still not able to bring the `OMMetaManager` 
service up, so want to throw `RuntimeException` as was thrown earlier in its 
parent catch block.



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