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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -553,6 +553,16 @@ private void processOMUpdateBatch(OMUpdateEventBatch 
events) {
       return;
     }
 
+    // A batch that failed both attempts only raises tasksFailed. The next 
sync drains this buffer and
+    // rebuilds from a checkpoint that already contains every queued batch. 
Applying the batches still
+    // waiting would move the task cursor up to the OmDeltaRequest cursor, so 
a restart before that
+    // rebuild would find nothing to redo and the failed batch would be lost.
+    if (hasTasksFailed()) {
+      LOG.debug("Skipping buffered OM update batch ending at sequence {} 
because a task has failed and " +
+          "reinitialization is pending.", events.getLastSequenceNumber());
+      return;

Review Comment:
   This can happen in theory, but only if the worker pauses for the whole time 
it takes to snapshot the OM DB and Recon then restarts before the rebuild 
finishes, which is very unlikely. Keeping the flag up longer would be worse: 
while it is up, Recon drops new OM updates, and those are not in the rebuild, 
so they would be lost for good. I'd like to keep this PR as it is.



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