nzw921rx commented on PR #11960:
URL: https://github.com/apache/seatunnel/pull/11960#issuecomment-7154785186

   I confirmed a CDC split recovery regression introduced by #11960. It affects 
the shared CDC enumerator, including jobs that run with Flink schema evolution 
disabled.
   
   `IncrementalSplitAssigner` sets `splitAssigned = true` as soon as it 
generates the splits. At that point, some splits may still be waiting in 
`remainingSplits`, and a split removed from the queue may still be in transit 
to its reader. The checkpoint persists the flag and offsets. On restore, 
`getNext()` sees an empty queue and `splitAssigned = true` and returns no work.
   
   I verified two recovery cases against merge commit `f34fa479` and its parent 
`ef9c7ee2`.
   
   | Scenario | Checkpoint timing | Result after restore |
   |---|---|---|
   | Flink 1.15.4 MiniCluster, two tables, three readers, 
`incremental.parallelism=2`, schema evolution disabled | Reader 0 owned 
`customers`. The `orders` split was still waiting for a reader. | Only 
`customers` reached the test sink. The other readers received `NoMoreSplits`, 
and the restored job completed another checkpoint with zero `orders` records. I 
reproduced this with both a retained checkpoint and a savepoint. |
   | Zeta component test, one table, one reader, `incremental.parallelism=1` | 
The enumerator had removed the only split from its queue. I paused delivery 
during serialization and allowed the enumerator and reader to acknowledge the 
checkpoint. | The checkpoint contained `splitAssigned=true` and zero reader 
splits. The reader had nothing to return, and the restored assigner produced no 
split. The parent commit regenerated it. |
   
   The Flink test used synthetic CDC records. The Zeta test used the production 
enumerator, reader, and checkpoint classes with a mocked Hazelcast transport. 
Both tests deliberately controlled the timing, so they establish reachability. 
Production frequency is unknown.
   
   I also checked the `3.1.0` tag. Its assigner persists only the start and 
stop offsets, so the single-split Zeta regression above was introduced after 
3.1.0. Simply reverting the flag would bring back a different problem. In the 
Flink parent-commit run, `orders` was read, but `customers` was assigned twice.
   
   I think this warrants a fix before the next release containing #11960. The 
regression tests should take a checkpoint at each of the two points above, 
restore it, and verify that **each captured table has exactly one active 
incremental reader and that a new record from each table reaches the sink 
exactly once**. Persisting only `remainingSplits` would still leave the Zeta 
handoff window open.
   
   [Split generation and 
assignment](https://github.com/apache/seatunnel/blob/f34fa479c99bad36958867b456f0dd1210e833a9/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/IncrementalSplitAssigner.java#L140-L156)
 · [Checkpoint 
contents](https://github.com/apache/seatunnel/blob/f34fa479c99bad36958867b456f0dd1210e833a9/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/IncrementalSplitAssigner.java#L244-L247)
 · [Enumerator-to-reader 
handoff](https://github.com/apache/seatunnel/blob/f34fa479c99bad36958867b456f0dd1210e833a9/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/IncrementalSourceEnumerator.java#L195-L203)
   
   @CloverDew @TyrantLucifer 


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