Skip to content

[flink] respect flink io tmp multi dirs to fix disk exhaustion#3617

Open
zuston wants to merge 4 commits into
apache:mainfrom
zuston:fixscantmpdir
Open

[flink] respect flink io tmp multi dirs to fix disk exhaustion#3617
zuston wants to merge 4 commits into
apache:mainfrom
zuston:fixscantmpdir

Conversation

@zuston

@zuston zuston commented Jul 8, 2026

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #3616

Brief change log

respect flink io tmp multi dirs to fix disk exhaustion

Tests

API and Format

Documentation

@zuston zuston marked this pull request as ready for review July 8, 2026 06:46
@luoyuxia luoyuxia requested a review from Copilot July 8, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DIRS entries.
  • 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.

Comment on lines 233 to 237
private static String[] splitPaths(@Nonnull String separatedPaths) {
return separatedPaths.length() > 0
? separatedPaths.split(",|" + File.pathSeparator)
: new String[0];
}
Comment on lines 107 to +108
.isEqualTo("/flink_tmp_dir/fluss");
assertThat(FlinkConnectorOptionsUtils.getClientScannerIoTmpDir(flussConfig, flinkConfig, 1))
@@ -290,7 +290,8 @@ public SourceReader<OUT, SourceSplitBase> createReader(SourceReaderContext conte

flussConf.set(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

zuston and others added 3 commits July 8, 2026 15:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zuston

zuston commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

updated. @wuchong @beryllw

@zuston zuston requested review from beryllw and wuchong July 8, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect scanner default log dirs on Yarn

4 participants