loserwang1024 commented on code in PR #2482:
URL: https://github.com/apache/flink-cdc/pull/2482#discussion_r1524414022
##########
flink-connector-mysql-cdc/src/main/java/com/ververica/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssigner.java:
##########
@@ -152,7 +153,15 @@ private MySqlSnapshotSplitAssigner(
this.currentParallelism = currentParallelism;
this.alreadyProcessedTables = alreadyProcessedTables;
this.remainingSplits = new CopyOnWriteArrayList<>(remainingSplits);
- this.assignedSplits = assignedSplits;
+ this.assignedSplits =
+ assignedSplits.entrySet().stream()
+ .sorted(Comparator.comparing(Map.Entry::getKey))
+ .collect(
+ Collectors.toMap(
+ Map.Entry::getKey,
+ Map.Entry::getValue,
+ (o, o2) -> o,
+ LinkedHashMap::new));
Review Comment:
@qg-lin, @ruanhang1993 , Hi, I understand why not sorted in
`getFinishedSnapshotSplitInfos` by splitId. But whether need to sort
`assignedSplits`? If not sort, any problem will occur?
--
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]