prashantwason commented on PR #18411:
URL: https://github.com/apache/hudi/pull/18411#issuecomment-4157169218

   @danny0405 @cshuo I've pushed a revised async approach that addresses both 
concerns:
   
   **The race condition is fixed** — `handleCoordinationRequest()` is now gated 
on `initFuture.thenCompose()`, so `startInstant()` on the 
`instantRequestExecutor` cannot race ahead of initialization. The `initFuture` 
only completes after `tryUpgrade()`, `initMetadataTable()`, and 
`restoreEvents()` finish.
   
   **No inconsistency from the write task's perspective** — both paths are 
covered:
   1. **Events** (`handleEventFromOperator`): submitted to the same 
single-threaded `executor`, so FIFO ordering guarantees initialization 
completes before any event processing
   2. **Coordination requests** (`handleCoordinationRequest`): gated on 
`initFuture`, so they block until initialization completes — the 
`RecordIndexPartitioner` MDT dependency is safe
   
   The key difference from the previous attempt: instead of letting 
coordination requests run immediately while init is still in progress, they now 
wait for init to complete via `CompletableFuture` composition. This gives us 
the benefit of not blocking the dispatcher thread while still ensuring the 
coordinator is fully initialized before any write operations begin.
   
   All 36 `TestStreamWriteOperatorCoordinator` tests pass.


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

Reply via email to