sumitagrawl commented on code in PR #8917:
URL: https://github.com/apache/ozone/pull/8917#discussion_r2272549793


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -227,6 +265,32 @@ public synchronized void 
reInitializeTasks(ReconOMMetadataManager omMetadataMana
     } catch (CancellationException ce) {
       LOG.error("Some tasks were cancelled with exception", ce);
     }
+
+    if (isRunSuccessful.get()) {
+      try {
+        reconDBProvider.replaceStagedDb(stagedReconDBProvider);
+        reconNamespaceSummaryManager.reinitialize(reconDBProvider);
+        reconContainerMetadataManager.reinitialize(reconDBProvider);
+        reprocessTaskStatus.setLastTaskRunStatus(0);
+        reprocessTaskStatus.recordRunCompletion();
+        LOG.info("Re-initialization of tasks completed successfully.");
+      } catch (Exception e) {
+        LOG.error("Re-initialization of tasks failed.", e);
+        reprocessTaskStatus.setLastTaskRunStatus(-1);
+        reprocessTaskStatus.recordRunCompletion();
+        // reinitialize the Recon OM tasks with the original DB provider
+        try {
+          reconNamespaceSummaryManager.reinitialize(reconDBProvider);
+          reconContainerMetadataManager.reinitialize(reconDBProvider);
+        } catch (IOException ex) {
+          LOG.error("Re-initialization of task manager failed.", e);
+        }
+      }
+    } else {
+      LOG.error("Reprocess of task has failed.");
+      reprocessTaskStatus.setLastTaskRunStatus(-1);
+      reprocessTaskStatus.recordRunCompletion();

Review Comment:
   updated



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -227,6 +265,32 @@ public synchronized void 
reInitializeTasks(ReconOMMetadataManager omMetadataMana
     } catch (CancellationException ce) {
       LOG.error("Some tasks were cancelled with exception", ce);
     }
+
+    if (isRunSuccessful.get()) {
+      try {
+        reconDBProvider.replaceStagedDb(stagedReconDBProvider);
+        reconNamespaceSummaryManager.reinitialize(reconDBProvider);
+        reconContainerMetadataManager.reinitialize(reconDBProvider);
+        reprocessTaskStatus.setLastTaskRunStatus(0);
+        reprocessTaskStatus.recordRunCompletion();
+        LOG.info("Re-initialization of tasks completed successfully.");
+      } catch (Exception e) {
+        LOG.error("Re-initialization of tasks failed.", e);
+        reprocessTaskStatus.setLastTaskRunStatus(-1);

Review Comment:
   updated



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