Skip to content

branch-4.0: [fix](backup) reject upload snapshots on broken storage path #61251 - #61435

Merged
yiguolei merged 2 commits into
branch-4.0from
auto-pick-61251-branch-4.0
Mar 23, 2026
Merged

branch-4.0: [fix](backup) reject upload snapshots on broken storage path #61251#61435
yiguolei merged 2 commits into
branch-4.0from
auto-pick-61251-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #61251

Backup upload reuses snapshot paths returned by MAKE_SNAPSHOT. When a
data dir is later marked as broken, the stale snapshot directory can
still remain on that disk and be picked up by upload. In that case the
upload task may continue into file checksum and remote upload logic with
a snapshot source that is no longer safe to read.
This change adds a broken-storage-path validation step to SnapshotLoader
local source path checking for upload. The check canonicalizes the
snapshot path, matches it to its DataDir, and rejects the source early
when the owning DataDir is offline or the path is listed in
broken_storage_path. That turns the broken-disk case into a normal task
error instead of letting upload continue on an invalid local snapshot
source.
The unit tests cover both the direct broken-path case and a
canonicalized symlink path to ensure the validation cannot be bypassed
by path indirection.
@Thearas

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Thearas

Copy link
Copy Markdown
Contributor

run buildall

@luwei16

Copy link
Copy Markdown
Contributor

run beut

### What problem does this PR solve?
Issue Number: None
Related PR: #61251
Problem Summary: Adjust the SnapshotLoader broken-path unit tests on branch-4.0 to preseed broken storage state through EngineOptions instead of calling add_broken_path(), so the tests keep the same coverage without triggering unrelated config persistence and stacktrace code paths in this branch worktree.
### Release note
None
### Check List (For Author)
- Test: Targeted BE UT build started in the isolated worktree but has not completed yet because the first worktree build is still compiling dependencies and BE UT objects
- Unit Test
- Behavior changed: No
- Does this need documentation: No
@luwei16

Copy link
Copy Markdown
Contributor

run buildall

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 94.74% (36/38) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage52.93% (19203/36280)
Line Coverage36.11% (178876/495417)
Region Coverage32.73% (138641/423532)
Branch Coverage33.70% (60236/178724)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 94.74% (36/38) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage71.28% (25316/35516)
Line Coverage53.94% (266752/494532)
Region Coverage51.52% (220410/427807)
Branch Coverage52.97% (95007/179367)

@yiguolei
yiguolei merged commit 5b94bd1 into branch-4.0Mar 23, 2026
27 of 29 checks passed
@github-actions
github-actionsBot deleted the auto-pick-61251-branch-4.0 branch March 23, 2026 06:00
Sign up for freeto 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.

6 participants

@Thearas@luwei16@doris-robot@hello-stephen@yiguolei@dataroaring