[flink] respect flink io tmp multi dirs to fix disk exhaustion#3617
[flink] respect flink io tmp multi dirs to fix disk exhaustion#3617zuston wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #3616 by improving how Fluss derives client.scanner.io.tmpdir from Flink’s io.tmp.dirs when running on YARN, including support for multiple tmp directories to avoid concentrating all temporary files on a single disk.
Changes:
- Add task-index aware tmp-dir selection and split handling for multiple Flink
TMP_DIRSentries. - Update Flink source readers to pass subtask index so different subtasks can use different tmp dirs.
- Extend unit tests to cover comma-separated and path-separator-separated tmp dir lists.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/utils/FlinkConnectorOptionsUtils.java | Adds multi-dir parsing and task-index based tmp dir selection logic. |
| fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/source/FlinkSource.java | Passes subtask index into tmp dir selection. |
| fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/tiering/source/TieringSource.java | Passes subtask index into tmp dir selection for tiering reader. |
| fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/utils/FlinkConnectorOptionsUtilTest.java | Adds coverage for multiple tmp dir formats and updates expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private static String[] splitPaths(@Nonnull String separatedPaths) { | ||
| return separatedPaths.length() > 0 | ||
| ? separatedPaths.split(",|" + File.pathSeparator) | ||
| : new String[0]; | ||
| } |
| .isEqualTo("/flink_tmp_dir/fluss"); | ||
| assertThat(FlinkConnectorOptionsUtils.getClientScannerIoTmpDir(flussConfig, flinkConfig, 1)) |
| @@ -290,7 +290,8 @@ public SourceReader<OUT, SourceSplitBase> createReader(SourceReaderContext conte | |||
|
|
|||
| flussConf.set( | |||
There was a problem hiding this comment.
Just a personal question, might be missing something here — since flussConf is a member field of the source, calling set seems to mutate it in place, and this config eventually gets passed down to the Connection and shared by the downstream scanners. So I'm wondering whether multiple readers reusing the same instance could end up sharing the same config. Would it be safer to copy it first before setting?
Curious how you see it @luoyuxia ?
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Purpose
Linked issue: close #3616
Brief change log
respect flink io tmp multi dirs to fix disk exhaustion
Tests
API and Format
Documentation