Skip to content

Add copy fallback for compaction hard links#18045

Open
shuwenwei wants to merge 3 commits into
masterfrom
fix-compaction-link-fallback
Open

Add copy fallback for compaction hard links#18045
shuwenwei wants to merge 3 commits into
masterfrom
fix-compaction-link-fallback

Conversation

@shuwenwei

@shuwenwei shuwenwei commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

This PR adds a shared FileUtils.createLink(..., fallBackToCopy) helper and uses it in compaction-related file linking paths.

When hard-link creation is unsupported or fails, these paths now fall back to copying the source file instead of failing immediately.

Changes

  • Add a FileUtils.createLink(Path, Path, boolean) helper with optional copy fallback.
  • Use the helper in compaction target preparation paths.
  • Use the helper when linking TsFile resources and modification files.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.31%. Comparing base (7f41f06) to head (c5800b9).

Files with missing lines Patch % Lines
...java/org/apache/iotdb/commons/utils/FileUtils.java 72.72% 3 Missing ⚠️
...dataregion/modification/v1/ModificationFileV1.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18045      +/-   ##
============================================
- Coverage     41.42%   41.31%   -0.12%     
  Complexity      318      318              
============================================
  Files          5282     5282              
  Lines        369246   369257      +11     
  Branches      47786    47787       +1     
============================================
- Hits         152978   152555     -423     
- Misses       216268   216702     +434     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant