devmadhuu opened a new pull request, #8962:
URL: https://github.com/apache/ozone/pull/8962

   ## What changes were proposed in this pull request?
   This PR change is to implement the `re-initialization` of OM tasks method as 
non-blocking and put in same `eventBuffer` which is used for pushing OM delta 
update events batch.
   
    **Key Changes Made:**
   
   ```
     1. Created Custom Event Types:
       - ReconEvent interface for common event handling
       - ReconTaskReInitializationEvent for async reinitialization triggers
       - OMUpdateEventBatch now implements ReconEvent
     2. Refactored Event Buffer:
       - OMUpdateEventBuffer now handles generic ReconEvent instead of just 
OMUpdateEventBatch
       - Supports both OM delta update events and custom control events
     3. Enhanced ReconTaskController:
       - Added queueReInitializationEvent() method for async reinitialization
       - Added updateOMMetadataManager() to maintain current OM metadata 
reference
       - Refactored processBufferedEventsAsync() to handle multiple event types
       - Split event processing into processReconEvent() → 
processOMUpdateBatch() / processReInitializationEvent()
     4. Updated OzoneManagerServiceProviderImpl:
       - Non-blocking approach: Replaced blocking reInitializeTasks() calls 
with async queueReInitializationEvent()
       - Event-driven: When buffer overflows or tasks fail, generates custom 
events instead of blocking
       - Fallback handling: If event queueing fails, falls back to sync 
reinitialization
   ```
   
   **How It Works Now:**
   
   ```
     1. Normal Flow: OM delta events are buffered and processed asynchronously
     2. Buffer Overflow Detection: When buffer is full:
       - Generates BUFFER_OVERFLOW reinitialization event
       - Clears buffer to discard pending events
       - Queues reinitialization event for async processing
       - Returns immediately (non-blocking!)
     3. Task Failure Detection: When delta tasks fail after retry:
       - Sets deltaTasksFailed flag
       - Next sync cycle detects failure and generates TASK_FAILURES 
reinitialization event
       - Returns immediately (non-blocking!)
     4. Async Reinitialization: Dedicated thread processes reinitialization 
event:
       - Calls reInitializeTasks() asynchronously
       - Resets appropriate flags after completion
       - Continues buffering and processing other delta events post the 
completion of reinitialization event.
   ```
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-13576
   
   ## How was this patch tested?
   Added new test: `TestOMUpdateEventBuffer.java` and did manual testing in 
local docker container using a python script
   to generate bulk batch of FSO , non-FSO keys.
   


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