ArafatKhan2198 commented on code in PR #6640:
URL: https://github.com/apache/ozone/pull/6640#discussion_r1651068424


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -549,12 +593,24 @@ public boolean syncDataFromOM() {
               // Reinitialize tasks that are listening.
               LOG.info("Calling reprocess on Recon tasks.");
               reconTaskController.reInitializeTasks(omMetadataManager);
+
+              // Update health status in ReconContext
+              reconContext.updateHealthStatus(new AtomicBoolean(true));
+              
reconContext.getErrors().remove(ReconContext.ErrorCode.GET_OM_DB_SNAPSHOT_FAILED);
+            } else {
+              metrics.incrNumSnapshotRequestsFailed();
+              // Update health status in ReconContext
+              reconContext.updateHealthStatus(new AtomicBoolean(false));
+              
reconContext.updateErrors(ReconContext.ErrorCode.GET_OM_DB_SNAPSHOT_FAILED);
             }
           } catch (InterruptedException intEx) {
             Thread.currentThread().interrupt();
           } catch (Exception e) {
             metrics.incrNumSnapshotRequestsFailed();
             LOG.error("Unable to update Recon's metadata with new OM DB. ", e);
+            // Update health status in ReconContext
+            reconContext.updateHealthStatus(new AtomicBoolean(false));

Review Comment:
   Done!
   



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