Skip to content

branch-4.0: [fix](fe) Skip decommissioning BE for load#65407

Open
liaoxin01 wants to merge 1 commit into
apache:branch-4.0from
liaoxin01:codex/pick-65049-to-branch-4.0
Open

branch-4.0: [fix](fe) Skip decommissioning BE for load#65407
liaoxin01 wants to merge 1 commit into
apache:branch-4.0from
liaoxin01:codex/pick-65049-to-branch-4.0

Conversation

@liaoxin01

Copy link
Copy Markdown
Contributor

Pick #65049

Problem Summary: Stream load backend selection could still choose a
backend that is being decommissioned because load availability only
checks alive/load-disabled/shutdown state. This can redirect new stream
load requests to a draining backend. This change adds an explicit
non-decommissioned selection policy and applies it to stream load
redirect, upload submitter, MySQL load, and transaction stream load
backend selection. Cloud stream load redirect and group commit backend
availability now also skip backends that are decommissioned or
decommissioning.
Copilot AI review requested due to automatic review settings July 9, 2026 07:53
@liaoxin01 liaoxin01 requested a review from morningman as a code owner July 9, 2026 07:53
@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?

@liaoxin01

Copy link
Copy Markdown
Contributor Author

run buildall

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens FE backend selection for load-related paths to exclude decommissioned/decommissioning BEs, preventing load tasks from being routed to BEs that are being removed from service.

Changes:

  • Extend BeSelectionPolicy with needNonDecommissioned and make needLoadAvailable() imply non-decommissioned selection.
  • Update backend selection logic for Stream Load, Routine Load, Group Commit, and Kafka meta requests to skip decommissioned/decommissioning BEs.
  • Add/adjust unit tests to validate decommissioning-aware backend selection behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
fe/fe-core/src/test/java/org/apache/doris/system/SystemInfoServiceTest.java Updates selection-policy tests to reflect “load available + non-decommissioned” behavior.
fe/fe-core/src/test/java/org/apache/doris/load/StreamLoadHandlerTest.java Adds test ensuring Stream Load backend selection skips decommissioning backends.
fe/fe-core/src/test/java/org/apache/doris/load/routineload/RoutineLoadManagerTest.java Updates mocks to satisfy new backend availability filtering in Routine Load manager logic.
fe/fe-core/src/test/java/org/apache/doris/load/routineload/RoutineLoadBackendSelectionTest.java Adds tests covering Routine Load backend selection behavior with decommissioning/load-disabled backends.
fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java Adds needNonDecommissioned and integrates it into matching and toString().
fe/fe-core/src/main/java/org/apache/doris/load/StreamLoadHandler.java Skips decommissioned/decommissioning BEs when selecting Stream Load backend in cloud mode.
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadManager.java Filters out load-unavailable and decommissioned/decommissioning BEs when computing per-BE capacity; refines reuse logic.
fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java Treats decommissioning backends as unavailable (not only in cloud mode) and improves error details.
fe/fe-core/src/main/java/org/apache/doris/datasource/kafka/KafkaUtil.java Centralizes backend availability checks for Kafka meta requests and excludes decommissioning BEs.
fe/fe-core/src/main/java/org/apache/doris/cloud/load/CloudRoutineLoadManager.java Uses load availability + non-decommissioned filtering for cloud routine load backend selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 192 to +193
BeSelectionPolicy policy5 = new BeSelectionPolicy.Builder().needLoadAvailable().build();
Assert.assertTrue(policy5.toString().contains("nonDecommissioned=true"));
Comment on lines +147 to +151
beIdToMaxConcurrentTasks = Env.getCurrentSystemInfo().getAllBackendIds(true).stream()
.filter(beId -> {
Backend backend = Env.getCurrentSystemInfo().getBackend(beId);
return backend != null && backend.isLoadAvailable()
&& !backend.isDecommissioned() && !backend.isDecommissioning();
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