Repository navigation
Conversation
biley06
force-pushed
the
fix/graceful-scale-down-recreation
branch
from
November 29, 2026 19:31
35a20bb to
2961d6b
Compare
Lower the StatefulSet replicas before deleting the drained pod. This prevents the StatefulSet from recreating the ordinal before scale-down completes. Fixes apache#566
biley06
force-pushed
the
fix/graceful-scale-down-recreation
branch
from
November 29, 2026 19:39
2961d6b to
bb317af
Compare
Author
|
Hi @Al-assad @catpineapple @intelligentfu8 @morningman , I've raised this PR to fix the phantom BE recreation issue during graceful scale-down. We encountered this issue internally while using Doris in our organization. The fix has been running on our fork and has eliminated phantom BE recreations and query failures during scale-downs in our verification. Could you please take a look and share your feedback on the approach? Thanks! |
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.
What problem does this PR solve?
Issue Number: close #566
Related PR: N/A
Problem Summary:
During graceful scale-down, the operator drains a backend and removes it from Doris, then deletes its Pod before reducing the StatefulSet replica count. During that gap, the StatefulSet still considers the ordinal part of its desired replica set. If the Pod disappears while that is true, the StatefulSet controller may create a replacement Pod.
The replacement backend can start and may register with FE or MetaService again, then be deleted during a later reconciliation while handling queries. This can cause query failures and leave stale backend entries.
This change lowers the StatefulSet replica count before deleting the Pod. If the replica update fails, the handler returns without deleting the Pod, leaving the graceful action available for a later reconciliation. If Kubernetes or an earlier reconciliation has already removed the Pod, the handler still lowers replicas and advances the action.
Release Note:
Fix graceful scale-down recreating a removed BE pod.
Check List (For Author)
Test
go test ./pkg/controller/sub_controller/disaggregated_cluster/computegroups -count=1passes.go vet ./...andgo build ./cmd/operatorpass.Behavior changed:
The StatefulSet replica count is lowered before the drained Pod is deleted.
Does this need documentation?
Check List (For Reviewer who merge this PR)