-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-37120][pipeline-connector/mysql] Add ending split chunk first to avoid TaskManager oom #3856
base: master
Are you sure you want to change the base?
Conversation
CI:https://github.com/beryllw/flink-cdc/actions/runs/12779452404 |
Adding the ending split chunk first changes the snapshot read result order. I will fix the unit test. |
THanks @beryllw for the contribution, the idea makes sense to me, but we need to consider the compatibility, a configuration is recommended |
If data consistency is not an issue, are there any compatibility concerns we need to address? |
@@ -498,7 +498,7 @@ private List<ChunkRange> splitUnevenlySizedChunks( | |||
chunkEnd = nextChunkEnd(jdbc, chunkEnd, tableId, splitColumn, max, chunkSize); | |||
} | |||
// add the ending split | |||
splits.add(ChunkRange.of(chunkStart, null)); | |||
splits.add(0, ChunkRange.of(chunkStart, null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good optimization, so both the largest and smallest unbounded chunks are completed in the first two splits, and subsequent chunks are bounded size.
What‘s more, could you add this optimization to |
Sure, i will check MongoDBChunkSplitter. |
…to avoid TaskManager oom
…void TaskManager oom
1004386
to
9a7ed71
Compare
I missed this issue #3704, good idea. Maybe support |
My previous PR provided both I think if there is no impact on restarting from the previous state, there is no compatibility issue, but adding a parameter to control it would be safer. |
...ysql/src/main/java/org/apache/flink/cdc/connectors/mysql/factory/MySqlDataSourceFactory.java
Show resolved
Hide resolved
I think adding a test in MySqlSourceITCase to test the case of restoring from failure will be better. |
agree. |
LGTM. |
What about |
Add ending split chunk first to avoid TaskManager oom