Skip to content

[to dev/1.3] Add copy fallback for compaction hard links#18083

Merged
jt2594838 merged 6 commits into
dev/1.3from
cp-pr-18045-dev-1.3
Jul 1, 2026
Merged

[to dev/1.3] Add copy fallback for compaction hard links#18083
jt2594838 merged 6 commits into
dev/1.3from
cp-pr-18045-dev-1.3

Conversation

@shuwenwei

Copy link
Copy Markdown
Member

Description

Backport of #18045 to dev/1.3.

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.
  • Replace remaining compaction hard-link calls with the helper, including recovery tests.

Verification

  • Searched compaction sources/tests for remaining Files.createLink / createHardlink usage; none remain.
  • Compile/build checks were not run per instruction.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.07%. Comparing base (9b124e4) to head (324345f).

Files with missing lines Patch % Lines
...java/org/apache/iotdb/commons/utils/FileUtils.java 72.72% 3 Missing ⚠️
...paction/execute/task/InnerSpaceCompactionTask.java 60.00% 2 Missing ⚠️
...xecute/task/InsertionCrossSpaceCompactionTask.java 60.00% 2 Missing ⚠️
...gine/dataregion/modification/ModificationFile.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev/1.3   #18083      +/-   ##
=============================================
- Coverage      43.07%   43.07%   -0.01%     
  Complexity       198      198              
=============================================
  Files           3626     3626              
  Lines         242522   242533      +11     
  Branches       29582    29583       +1     
=============================================
- Hits          104473   104468       -5     
- Misses        138049   138065      +16     

☔ 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.

@jt2594838 jt2594838 merged commit eb42ffb into dev/1.3 Jul 1, 2026
19 checks passed
@jt2594838 jt2594838 deleted the cp-pr-18045-dev-1.3 branch July 1, 2026 10:36
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.

2 participants