You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "gong (via GitHub)" <gi...@apache.org> on 2023/05/30 03:34:37 UTC

[GitHub] [inlong] gong commented on a diff in pull request #8044: [INLONG-8038][Sort] Optimize MySQL CDC chunk splitting

gong commented on code in PR #8044:
URL: https://github.com/apache/inlong/pull/8044#discussion_r1209672869


##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/cdc/mysql/source/assigners/MySqlSnapshotSplitAssigner.java:
##########
@@ -397,6 +397,14 @@ private void closeExecutorService() {
         }
     }
 
+    private void addNewlyAddedSplits(List<MySqlSchemalessSnapshotSplit> schemaLessSnapshotSplits) {
+        int size = schemaLessSnapshotSplits.size();
+        // move the last snapshot split to the front of the remaining splits to prevent OOM
+        // caused by the excessive data of the last snapshot split.
+        remainingSplits.add(0, schemaLessSnapshotSplits.get(size - 1));
+        remainingSplits.addAll(schemaLessSnapshotSplits.subList(0, size - 1));

Review Comment:
   `remainSplits` is all splits, `remainingSplits.add(0, schemaLessSnapshotSplits.get(size - 1));` will cause other table split lost



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org