loserwang1024 commented on code in PR #4101:
URL: https://github.com/apache/flink-cdc/pull/4101#discussion_r2343231804
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/debezium/reader/BinlogSplitReader.java:
##########
@@ -148,8 +150,6 @@ public void submitSplit(MySqlSplit mySqlSplit) {
currentBinlogSplit),
t);
readException = t;
- } finally {
- stopBinlogReadTask();
Review Comment:
No, snapshot will finish with end watermark.
<img width="754" height="639" alt="image"
src="https://github.com/user-attachments/assets/5b45c98c-67b7-4b8d-82a7-38ba01341f20"
/>
To be honest, https://github.com/apache/flink-cdc/pull/2901 was wrongly
added this before. For example, if snapshot mode add a lot of pending records
to queue. Before these queue be taken, the
`((StoppableChangeEventSourceContext) context).stopChangeEventSource()`, thus
BinlogSplitReader is stopped. Thus pending records in queue will be ignored!
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/reader/external/IncrementalSourceScanFetcher.java:
##########
@@ -86,18 +88,21 @@ public IncrementalSourceScanFetcher(FetchTask.Context
taskContext, int subtaskId
}
@Override
- public void submitTask(FetchTask<SourceSplitBase> fetchTask) {
+ public Future<?> submitTask(FetchTask<SourceSplitBase> fetchTask) {
+ CompletableFuture<Void> completableFuture = new CompletableFuture<>();
+
this.snapshotSplitReadTask = fetchTask;
this.currentSnapshotSplit = fetchTask.getSplit().asSnapshotSplit();
taskContext.configure(currentSnapshotSplit);
this.queue = taskContext.getQueue();
this.hasNextElement.set(true);
this.reachEnd.set(false);
- executorService.execute(
+ return executorService.submit(
() -> {
try {
snapshotSplitReadTask.execute(taskContext);
+ completableFuture.complete(null);
Review Comment:
remove it
--
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]