DanielLeens commented on code in PR #13389:
URL: https://github.com/apache/seatunnel/pull/13389#discussion_r4707317858


##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/SnapshotSplitAssigner.java:
##########
@@ -227,9 +227,11 @@ public void onCompletedSplits(List<SnapshotSplitWatermark> 
completedSplitWaterma
 
     @Override
     public void addSplits(Collection<SourceSplitBase> splits) {
+        boolean restoredCompletedSplit = false;

Review Comment:
   Thanks, @yraivo. A shared completion-only helper called once after the 
add-back loop is a good way to remove this duplication. Please keep restoration 
itself separate: `restoreCompletedSnapshotSplit` uses `putIfAbsent` for both 
watermark maps (lines 340-341), whereas `onCompletedSplits` overwrites the 
reported entries (lines 201-203). Calling the latter for every restored split 
would change checkpoint-watermark precedence.
   
   Run the completion helper only after the whole batch is reconciled, because 
an unfinished split later in the same batch is requeued and removes its old 
completion entry (lines 240-244). Preserve the parallelism=1 immediate 
completion versus multi-reader checkpoint-completion boundary. That addresses 
the duplication visible here; @nzw921rx can confirm whether the original 
comment intended a wider refactor. I am not confirming a fix before a new 
commit, and this optional cleanup does not reopen my previous source blocker by 
itself. Current head remains `4c7c9f6c4611`; no local test or new full source 
review was performed.



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