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

   ## Purpose
   
   Fixes #11676: MySQL CDC job runs but writes nothing after failure restart — 
restored splits never assigned to the waiting reader.
   
   ## Root Cause
   
   `IncrementalSourceEnumerator.addSplitsBack()` only called 
`splitAssigner.addSplits(splits)` without re-triggering `assignSplits()`. When 
the restored split arrived after the reader had already sent its split request 
(parked in `readersAwaitingSplit`), the split sat in the assigner but was never 
dispatched to the waiting reader, causing the CDC job to silently produce no 
data.
   
   ## Fix
   
   - Made `addSplitsBack()` synchronized (matching other state-modifying 
methods: `run()`, `handleSplitRequest()`, `notifyCheckpointComplete()`)
   - Added `if (running) assignSplits()` after adding restored splits to the 
assigner, so the restored split is immediately dispatched to the currently 
waiting reader
   
   This is a 3-line change in `IncrementalSourceEnumerator.java`.
   
   ## Verification
   
   - Unit tests: 
`IncrementalSourceEnumeratorTest#shouldAssignRestoredSplitsToWaitingReader` and 
`#shouldNotAssignSplitsBackWhenNotRunning` — both pass (2/2)
   - `./mvnw spotless:apply` passes
   - `./mvnw test -pl connector-cdc-base 
-Dtest=IncrementalSourceEnumeratorTest` — BUILD SUCCESS
   
   ## Changes
   
   - 
`connector-cdc/connector-cdc-base/.../enumerator/IncrementalSourceEnumerator.java`
 — +3 lines (synchronized + assignSplits)
   - 
`connector-cdc/connector-cdc-base/.../enumerator/IncrementalSourceEnumeratorTest.java`
 — new test file with 2 test cases


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