Savonitar opened a new pull request, #325:
URL: https://github.com/apache/flink-connector-kafka/pull/325

   ## What is the purpose of the change
   
   Backport #300 (upstream commit `9c69ad689515705361e2a7a3e4d7dd2cccfaf412`) 
to `v3.4`, following the [maintainer's 
request](https://github.com/apache/flink-connector-kafka/pull/300#issuecomment-5761942266).
   
   A bounded `DynamicKafkaSource` can signal a reader again after it has 
finished when another reader registers or returns splits. The original failure 
included:
   
   ```text
   An OperatorEvent from an OperatorCoordinator to a task was lost
   TaskNotRunningException: Task is not running, but in state FINISHED
   ```
   
   ## Brief change log
   
   - Send completion once per reader registration and re-arm it when that 
reader registers again.
   - Defer completion while registering readers or assigning returned splits 
across clusters, then recheck after assignment finishes.
   - Forward the real completion callback in the test factory and record the 
exact assigned split IDs when completion is signalled.
   
   This is adapted to the release branch: it has no `ReaderRecoveryGate`, 
reported-split recovery or retained-split recovery, so the corresponding 
main-branch code and two tests do not apply. The related reader replay fix is 
already present via #317; backports of #289 or #295 are not required for this 
adaptation. Metadata-change re-signalling remains outside this backport, as in 
#300.
   
   ## Verifying this change
   
   Three regression tests are included in `DynamicKafkaSourceEnumeratorTest`:
   
   - `testBoundedSourceSignalsNoMoreSplitsOncePerReader`
   - `testBoundedSourceAssignsAllClustersBeforeCompletingLateReaders`
   - `testBoundedSourceCompletesRestartedReaderAfterReturnedSplits`
   
   They check completion counts and the complete split set at the moment of 
completion.
   
   Local verification against `v3.4` at 
`22310e625ecfe352a217035297f90d1d8ec10e63`:
   
   - Static review of both guarded assignment paths and callback wiring 
completed.
   - `git apply --check --whitespace=error` passed against the pinned release 
sources.
   - The two changed Java files pass Google Java Format 1.7 in AOSP style, 
matching the branch's parent formatter version. This is a direct formatter 
check, not a full Maven Spotless run.
   - Compilation, Maven Checkstyle, unit tests and integration tests have not 
been run for this backport. Repeated idle-reader integration-test runs: **0**. 
These checks remain pending; the main-branch review results do not establish 
backport test success.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies: no.
   - Public API, Table options or PyFlink wrappers: no.
   - Checkpointed state, serializers or exactly-once delivery: yes, completion 
ordering when returned splits are reassigned; state formats and serializers are 
unchanged.
   - Per-record code paths: no.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? No; this is a correctness 
fix.
   - If yes, how is the feature documented? Not applicable.
   - If the docs changed, are both `docs/content` and `docs/content.zh` 
updated? Not applicable; no documentation changes.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes
   
   Generated-by: OpenAI Codex (GPT-6)
   


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