Copilot commented on code in PR #12093:
URL: https://github.com/apache/ozone/pull/12093#discussion_r4676092190
##########
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 guard can still be bypassed in the race it is intended to prevent. The
async worker may dequeue the next batch and be preempted before reaching this
check; `queueReInitializationEvent` then drains the remaining queue, offers the
rebuild event, and clears `tasksFailed` before that rebuild event is processed.
When the worker resumes, this check sees `false`, applies the later batch, and
can advance the cursor; a restart before the rebuild then has the same
lost-batch window. Keep `tasksFailed` set until `processReInitializationEvent`
starts (or otherwise synchronize the flag reset with processing of
already-dequeued batches).
--
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]