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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -820,6 +829,23 @@ public void resetEventFlags() {
     resetTasksFailureFlag();
   }
 
+  private void updateOMSyncTrackingSeqs(long rebuiltFromSeq) {

Review Comment:
   Calling this method could be risky with race conditions because 
`syncDataFromOM` method thread also updates these staskUpdaters sequence 
numbers and triggering this API endpoint independently could overwrite over 
each other.



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -562,6 +565,27 @@ boolean updateReconOmDBWithNewSnapshot() throws 
IOException {
     }
   }
 
+  @Override
+  public OMDBReprocessResponse triggerTaskRebuild() {
+    if (omMetadataManager == null || omMetadataManager.getStore() == null) {
+      return new OMDBReprocessResponse(OMDBReprocessResponse.Status.RETRY,
+          "Recon has not loaded an OM DB yet, so there is nothing to rebuild. 
Ensure an OM DB snapshot is "
+              + "present in the Recon OM DB directory and has been loaded, 
then retry.");
+    }
+
+    reconTaskController.resetRetryCounters();

Review Comment:
   Do not call this method here, because it is resetting two counters. We want 
to reset only `lastRetryTimestamp`. You can directly reset this counter inside 
synchronized scope of `queueReInitializationEvent`. Check the comment 
[here](https://github.com/apache/ozone/pull/10825/changes#r3630701057).



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########


Review Comment:
   You can reset the counter here for 2 sec delay here:
     if (reason == ReInitializationReason.MANUAL_OM_DB_REBUILD) {
       lastRetryTimestamp.set(0);
     }



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