Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reject the opsRequest that offlines all the replicas of a component #8834

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yipeng1030
Copy link
Contributor

fix #8737

add a validation rule that a opsRequest can't offlines all the online replicas of a component.

@github-actions github-actions bot added the size/S Denotes a PR that changes 10-29 lines. label Jan 20, 2025
@apecloud-bot apecloud-bot added the pre-approve Fork PR Pre Approve Test label Jan 20, 2025
@yipeng1030 yipeng1030 changed the title bugfix: reject the opsRequest that offlines all the replicas of a component fix: reject the opsRequest that offlines all the replicas of a component Jan 20, 2025
@apecloud-bot apecloud-bot added pre-approve Fork PR Pre Approve Test and removed pre-approve Fork PR Pre Approve Test labels Jan 20, 2025
@yipeng1030 yipeng1030 marked this pull request as ready for review January 20, 2025 14:18
@yipeng1030 yipeng1030 requested review from wangyelei and a team as code owners January 20, 2025 14:18
@@ -438,6 +438,9 @@ func (r *OpsRequest) validateHorizontalScalingSpec(hScale HorizontalScaling, com
if replicaChanger.ReplicaChanges != nil && allReplicaChanges > *replicaChanger.ReplicaChanges {
return fmt.Errorf(`%s "replicaChanges" can't be less than the sum of "replicaChanges" for specified instance templates`, msgPrefix)
}
if isScaleIn && len(offlineOrOnlineInsNames) == int(compSpec.Replicas) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It should follow the replicas limit rather than directly rejecting such requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-approve Fork PR Pre Approve Test size/S Denotes a PR that changes 10-29 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]HscaleOfflineInstances is always in running status when scaleIn component that only has 1 replicas
3 participants