branch-4.0: [fix](fe) Skip decommissioning BE for load#65407
Open
liaoxin01 wants to merge 1 commit into
Open
Conversation
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.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
There was a problem hiding this comment.
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
BeSelectionPolicywithneedNonDecommissionedand makeneedLoadAvailable()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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pick #65049