You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ruanhang1993 (via GitHub)" <gi...@apache.org> on 2026/03/10 07:32:54 UTC
Re: [PR] [FLINK-38218] Fix MySQL CDC binlog split metadata split transmission [flink-cdc]
ruanhang1993 commented on code in PR #4087:
URL: https://github.com/apache/flink-cdc/pull/4087#discussion_r2909892178
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/split/MySqlBinlogSplit.java:
##########
@@ -58,6 +62,19 @@ public MySqlBinlogSplit(
int totalFinishedSplitSize,
boolean isSuspended) {
super(splitId);
+
+ Set<String> seenSplitIds = new HashSet<>();
+ for (FinishedSnapshotSplitInfo splitInfo : finishedSnapshotSplitInfos) {
+ if (seenSplitIds.contains(splitInfo.getSplitId())) {
+ throw new IllegalArgumentException(
+ String.format(
+ "Found duplicate split ID %s in finished snapshot split infos",
+ splitInfo.getSplitId()));
+ }
+
+ seenSplitIds.add(splitInfo.getSplitId());
+ }
Review Comment:
Please extract this part of the code into a separate method to encapsulate 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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org