Skip to content

branch-4.0: [fix](filecache) Disable sync file cache clear in http api(pick#64321)#64460

Open
freemandealer wants to merge 1 commit into
apache:branch-4.0from
freemandealer:pick-branch-4.0-pr-64321-20260612
Open

branch-4.0: [fix](filecache) Disable sync file cache clear in http api(pick#64321)#64460
freemandealer wants to merge 1 commit into
apache:branch-4.0from
freemandealer:pick-branch-4.0-pr-64321-20260612

Conversation

@freemandealer

Copy link
Copy Markdown
Member

Pick from #64321

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: The file cache HTTP clear endpoint allowed callers to request synchronous clear with sync=true. The synchronous clear path is kept for unit tests and internal callers, but it is not safe to expose through the HTTP API. This change makes the HTTP op=clear endpoint always use async clear. The default behavior remains async, and explicit sync=true returns a warning message while still running async clear. Segment-specific HTTP clear also uses async remove instead of the synchronous remove path.

### Release note

The BE /api/file_cache?op=clear HTTP API no longer supports synchronous clearing. Requests with sync=true now run async clear and return a warning message.

### Check List (For Author)

- Test: Unit Test
    - DORIS_TOOLCHAIN=clang DISABLE_BE_JAVA_EXTENSIONS=ON ENABLE_INJECTION_POINT=ON ENABLE_CACHE_LOCK_DEBUG=0 ENABLE_PCH=0 sh run-be-ut.sh --run --filter=FileCacheActionTest.*
- Behavior changed: Yes. HTTP file cache clear no longer exposes synchronous clear.
- Does this need documentation: No

(cherry picked from commit 29d3a6f)
Picked-from: apache#64321
@hello-stephen

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?

@freemandealer

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.48% (25528/35711)
Line Coverage 54.34% (270617/497962)
Region Coverage 52.13% (225099/431834)
Branch Coverage 53.43% (96690/180959)

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