morozov commented on code in PR #4087:
URL: https://github.com/apache/flink-cdc/pull/4087#discussion_r2954320584


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlHybridSplitAssigner.java:
##########
@@ -208,9 +206,7 @@ public void close() {
 
     private MySqlBinlogSplit createBinlogSplit() {
         final List<MySqlSchemalessSnapshotSplit> assignedSnapshotSplit =
-                snapshotSplitAssigner.getAssignedSplits().values().stream()
-                        .sorted(Comparator.comparing(MySqlSplit::splitId))
-                        .collect(Collectors.toList());
+                new 
ArrayList<>(snapshotSplitAssigner.getAssignedSplits().values());

Review Comment:
   > Assuming the shards saved by the Enumerator are `split3`, `split2`, 
`split1`, they will be sorted in the original way as `split1`, `split2`, 
`split3`.
   > If the Source Reader of a job has already obtained `split1` and `split2` 
\[...]
   
   Is this possible?
   
   1. Finished snapshot split infos are built in the order of split assignment: 
https://github.com/apache/flink-cdc/blob/2e82317810f1fe62bc75d4bc22247668d9613f20/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssigner.java#L397-L399
   2. They are sent to the source reader in the same order: 
https://github.com/apache/flink-cdc/blob/4bab36707b781d2221d4d5c6b515b074b72789ec/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/enumerator/MySqlSourceEnumerator.java#L304-L306
   
   This is true for both the pre-upgrade and post-upgrade versions.
   
   So if before restoring the job from a checkpoint, the enumerator has the 
splits/infos in the order of `split3`, `split2`, `split1`, the source reader 
will have a prefix of this list (e.g. `split3`, `split2`) but not `split1` and 
`split2`.



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