zhang-arvin opened a new pull request, #20092:
URL: https://github.com/apache/druid/pull/20092

   ## Description
   
   Fixes #18282 - Kafka offset auto-reset behavior.
   
   This PR makes three changes to improve how Kafka offset reset is handled:
   
   ### 1. KafkaIndexTaskRunner: Re-throw OffsetOutOfRangeException
   Instead of swallowing the `OffsetOutOfRangeException` in `getRecords()` with 
`possiblyResetOffsetsOrWait()`, the exception is now re-thrown to let the 
supervisor handle the reset centrally. This aligns the Kafka task runner with 
the Kinesis task runner behavior.
   
   ### 2. SeekableStreamSupervisor.resetInternal: Fix metadata merge
   Changed `currentMetadata.minus(resetMetadata)` to 
`currentMetadata.plus(resetMetadata)` when computing the new metadata during 
reset. The `minus` operation was incorrect — during reset, we need to add the 
reset partitions to the current metadata, not subtract them.
   
   ### 3. SeekableStreamSupervisor.createNewTasks: Emit alert instead of 
throwing
   When partitions need reset in `createNewTasks()`, the code now emits an 
alert via `log.makeAlert()` instead of throwing a `StreamException`. This 
allows the task creation loop to continue processing other task groups after 
handling the reset.


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