Uh oh!
There was an error while loading. Please reload this page.
[fix](cloud) Fix warmup inflight count not decremented on early return - #60480
Conversation
Thearas
commented
Feb 3, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
deardeng
commented
Feb 3, 2026
run buildall |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0491cea to
0c66eacCompareDuring cloud tablet decommission, some tablets take unexpectedly long time (5+ minutes) to migrate because FE keeps waiting for warmup tasks to complete, even though the tasks have already failed. Root cause: In `FileCacheBlockDownloader::download_file_cache_block()`, when early return occurs (e.g., tablet not found, rowset not found, storage resource error), the `_inflight_tablets` count is not decremented. This causes: 1. `check_download_task()` always returns `done=false` for these tablets 2. FE's `checkInflightWarmUpCacheAsync()` waits until timeout (default 300s) 3. Tablet migration is blocked unnecessarily Example log showing the issue: ``` W download_file_cache_block: tablet_id=xxx rowset_id not found, rowset_id=xxx ``` After this warning, the tablet's inflight count remains, causing the 5-minute wait. 1. Extract the inflight count decrement logic into a reusable lambda `decrease_inflight_count` 2. Call `decrease_inflight_count()` in all early return paths: - When `get_tablet()` fails - When `rowset_id` is not found - When `remote_storage_resource()` fails 3. Refactor `download_done` callback to reuse `decrease_inflight_count`, eliminating code duplication 4. Use value capture for `decrease_inflight_count` in `download_done` lambda to ensure lifetime safety if the callback is ever called asynchronously 5. Add unit tests to verify inflight count is correctly decremented on failures Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0c66eac to
7df33deComparedeardeng
commented
Feb 3, 2026
run buildall |
doris-robot
commented
Feb 3, 2026
TPC-H: Total hot run time: 32304 ms |
doris-robot
commented
Feb 3, 2026
ClickBench: Total hot run time: 28.29 s |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
deardeng
commented
Feb 5, 2026
run beut |
deardeng
commented
Feb 5, 2026
run external |
deardeng
commented
Feb 5, 2026
run nonConcurrent |
deardeng
commented
Feb 5, 2026
run p0 |
deardeng
commented
Feb 6, 2026
run buildall |
doris-robot
commented
Feb 6, 2026
TPC-H: Total hot run time: 30433 ms |
doris-robot
commented
Feb 6, 2026
ClickBench: Total hot run time: 28.27 s |
hello-stephen
commented
Feb 6, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 6, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
PR approved by at least one committer and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
…ght count (apache#59093) (apache#60480) This commit merges two bug fixes related to cloud components: 1. Fix balanced_tablets_shards leak memory and fix some file cache cases (apache#59093). 2. Fix warmup inflight count not decremented on early return (apache#60480).
…ght count (apache#59093) (apache#60480) This commit merges two bug fixes related to cloud components: 1. Fix balanced_tablets_shards leak memory and fix some file cache cases (apache#59093). 2. Fix warmup inflight count not decremented on early return (apache#60480).
…ght count (#59093) (#60480) (#61985) This commit merges two bug fixes related to cloud components: 1. Fix balanced_tablets_shards leak memory and fix some file cache cases (#59093). 2. Fix warmup inflight count not decremented on early return (#60480). ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
Proposed changes
Problem
During cloud tablet decommission, some tablets take unexpectedly long time (5+ minutes) to migrate because FE keeps waiting for warmup tasks to complete, even though the tasks have already failed on BE side.
Root cause: In
FileCacheBlockDownloader::download_file_cache_block(), when early return occurs (e.g., tablet not found, rowset not found, storage resource error), the_inflight_tabletscount is not decremented. This causes:check_download_task()always returnsdone=falsefor these tabletscheckInflightWarmUpCacheAsync()waits until timeout (default 300 seconds)Example log showing the issue:
After this warning, the tablet's inflight count remains in
_inflight_tabletsmap, causing the 5-minute wait before FE times out and proceeds.Solution
Extract the inflight count decrement logic into a reusable lambda
decrease_inflight_countCall
decrease_inflight_count()in all early return paths:get_tablet()failsrowset_idis not foundremote_storage_resource()failsRefactor
download_donecallback to reusedecrease_inflight_count, eliminating code duplicationUse value capture for
decrease_inflight_countindownload_donelambda to ensure lifetime safety if the callback is ever called asynchronously in the futureAdd unit tests to verify inflight count is correctly decremented on failures
Further comments
This bug also causes a minor memory leak: entries in
_inflight_tabletsmap are never cleaned up when warmup fails, slowly accumulating over time (cleared on BE restart).Checklist(Required)