Skip to content

branch-4.2: [improvement](be) Use thread pool scan scheduler by default #68610 - #69508

Merged
yiguolei merged 1 commit into
apache:branch-4.2from
mrhhsg:pick-68610-branch-4.2
Oct 24, 2026
Merged

yiguolei merged 1 commit into
apache:branch-4.2from
mrhhsg:pick-68610-branch-4.2

Conversation

@mrhhsg

@mrhhsg mrhhsg commented Oct 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Use the existing thread-pool scheduler by default for internal and external scans. The task executor remains available through the corresponding explicit configuration options.
  • Convert Doris exceptions raised during row-ID V2 fetch RPC processing on a thread-pool worker into an error status in the RPC response.

Backport scope

Cherry-picked from #68610 for branch-4.2. This branch does not have the master-side shared scan LIMIT counter or the associated scanner/context APIs, so its existing scanner behavior is retained. The backport includes the scheduler defaults, the row-ID RPC exception boundary, and focused tests without importing unrelated master-side scan changes.

Tests

  • ASAN BE and FE build: BUILD_TYPE=ASAN ./build.sh --be --fe -j 32 — passed.
  • Focused BE unit tests covering row-ID fetch, external scan task submission, workload-group schedulers, scanner context, and scanner projection — 82 passed.
  • query_p0/limit regression on an isolated local FE/BE cluster — 18 suites passed.
  • clang-format.sh, check-format.sh, and git diff --check — passed.

Release note

Internal and external scans now use the thread-pool scheduler by default. Set enable_task_executor_in_internal_table or enable_task_executor_in_external_table to true to opt back into the task executor for the respective scan type.

### What problem does this PR solve?

Issue Number: None

Related PR: apache#68610

Problem Summary: Both internal and external scans use the task-executor scheduler by default on branch-4.2, while the thread-pool scheduler is the intended stable default. Switch both defaults to the thread pool, retaining explicit task-executor opt-in. A row-ID fetch RPC callback runs on a plain thread-pool worker, so a Doris exception while decoding a request could terminate the BE; convert it to the response status before completing the RPC.

Cherry-picked from apache#68610. Conflict resolution: branch-4.2 has no shared scan LIMIT counter or the master-side scanner/context APIs, so the master-only shared-LIMIT changes and tests were not ported. Keep the branch-native scanner implementation and adapt the scheduler/RPC tests to branch-4.2 headers. No unrelated master changes were imported.

(cherry picked from commit e0bf487)

### Release note

Internal and external scans use the thread-pool scan scheduler by default. Set enable_task_executor_in_internal_table or enable_task_executor_in_external_table to true to opt back into the task executor.

### Check List (For Author)

- Test: Unit Test: 82 focused BE ASAN tests passed, including RowIdStorageReaderTest and WorkloadGroupManagerTest.
    - Regression test: query_p0/limit, 18 suites passed on an isolated local FE/BE cluster.
    - Manual test: ASAN BE+FE build, clang-format, check-format, FE checkstyle and git diff --check passed.
- Behavior changed: Yes (default scheduler selection for both internal and external scans).
- Does this need documentation: No
@mrhhsg

mrhhsg commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

run buildall

@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?

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 85.71% (6/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 64.29% (29912/46528)
Line Coverage 49.13% (315522/642175)
Region Coverage 44.98% (254152/565057)
Branch Coverage 46.62% (119954/257288)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.31% (34478/45184)
Line Coverage 61.16% (389485/636795)
Region Coverage 57.98% (328122/565967)
Branch Coverage 59.00% (151617/256996)

@mrhhsg
mrhhsg marked this pull request as ready for review October 24, 2026 03:08
@mrhhsg
mrhhsg requested a review from yiguolei as a code owner October 24, 2026 03:08
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.31% (34478/45184)
Line Coverage 61.16% (389485/636795)
Region Coverage 57.98% (328122/565967)
Branch Coverage 59.00% (151617/256996)

@yiguolei
yiguolei merged commit 8134f16 into apache:branch-4.2 Oct 24, 2026
35 of 36 checks passed
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.

3 participants