devmadhuu commented on code in PR #8962:
URL: https://github.com/apache/ozone/pull/8962#discussion_r2318998626
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -423,12 +463,348 @@ public void resetEventBufferOverflowFlag() {
}
@Override
- public boolean hasDeltaTasksFailed() {
- return deltaTasksFailed.get();
+ public boolean hasTasksFailed() {
+ return tasksFailed.get();
+ }
+
+ @Override
+ public void resetTasksFailureFlag() {
+ tasksFailed.compareAndSet(true, false);
+ }
+
+ @Override
+ public synchronized ReconTaskController.ReInitializationResult
queueReInitializationEvent(
+ ReconTaskReInitializationEvent.ReInitializationReason reason) {
+ LOG.info("Queueing task reinitialization event due to: {} (retry attempt
count: {})", reason,
+ eventProcessRetryCount);
+
+ Long currentTime = validateRetryCountAndDelay();
+ if (currentTime == null) {
+ return ReInitializationResult.RETRY_LATER;
+ }
+
+ // Drain all events in buffer and cleanup any existing checkpoints before
falling back to full snapshot.
+ // Events can be present in queue when reinit checkpoint creation fails
multiple times because only after
+ // successful creation of checkpoint, we are clearing the event buffer.
+ drainEventBufferAndCleanExistingCheckpoints();
+
+ // Try checkpoint creation (single attempt per iteration)
+ ReconOMMetadataManager checkpointedOMMetadataManager = null;
+
+ try {
+ LOG.info("Attempting checkpoint creation (retry attempt: {})",
eventProcessRetryCount + 1);
+ checkpointedOMMetadataManager =
createOMCheckpoint(currentOMMetadataManager);
+ LOG.info("Checkpoint creation succeeded");
+ } catch (IOException e) {
+ LOG.error("Checkpoint creation failed: {}", e.getMessage());
+ handleEventFailure(currentTime);
+ return getEventRetryResult();
+ }
+
+ // Create and queue the reinitialization event with checkpointed metadata
manager
+ ReconTaskReInitializationEvent reinitEvent =
+ new ReconTaskReInitializationEvent(reason,
checkpointedOMMetadataManager);
+ boolean queued = eventBuffer.offer(reinitEvent);
+ // If reinitialization event queued successfully, reset event buffer
overflow flag and task failure flag,
+ // so that we can resume queuing the delta events.
+ if (queued) {
+ resetEventFlags();
+ resetRetryCounters();
Review Comment:
Want to separate retry times for queuing and reprocess, that is why
resetting here also.
--
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]