-
Notifications
You must be signed in to change notification settings - Fork 495
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
support scale in tikv simultaneously #3881
support scale in tikv simultaneously #3881
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
6e1bda7
to
eb862dd
Compare
@duduainankai Thanks for the contribution!
Please feel free to add more cases. It would be better to add e2e cases for this change. |
I already done some of these tests in unit test, and I will fill up reset. After that I will try to add e2e cases. |
Codecov Report
@@ Coverage Diff @@
## master #3881 +/- ##
==========================================
- Coverage 67.91% 62.47% -5.44%
==========================================
Files 175 171 -4
Lines 18612 18155 -457
==========================================
- Hits 12641 11343 -1298
- Misses 4877 5714 +837
- Partials 1094 1098 +4
|
@duduainankai
|
@duduainankai Just a friendly ping, are you available to continue working on this PR? |
@DanielZhangQD oh sorry for the slow response. I would like to continue on this PR but it's a little busy these days, so maybe I need more time. Is there any ETA for this feature to be merged ? If it's out of my time I will let you know first. |
@duduainankai Thanks a lot! |
@DanielZhangQD |
And maybe you can review the current PR first, I already fill up the case in unit test. @DanielZhangQD |
OK. /cc @csuzhangxc |
Hi, I already finish "support scale in multiple TiFlash Pods at the same time" and add test for it, mainly copy from But I found it a little different when do scale in between TiKV and TiFlash (like no |
@duduainankai We need to keep the preCheck for the TiKV, as for the TiFlash, it's not done yet, please refer to #3170. |
BTW, there are a lot of changes in this PR, please add e2e tests to cover the changes. |
Got. |
0d568f3
to
3b96df3
Compare
pkg/manager/member/tiflash_scaler.go
Outdated
tc, ok := meta.(*v1alpha1.TidbCluster) | ||
if !ok { | ||
return nil | ||
return fmt.Errorf("tiflashScaler.ScaleIn: failed to convert cluster %s/%s", meta.GetNamespace(), meta.GetName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return error here will cause the TC to be resynced, however, what's the point of resync here if it's not a TC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't notice that TiFlash ignore this error since it's determined an error in TiKV.
So the difference here is by design ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think TiKV should also ignore this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got. I will correct it.
pkg/manager/member/tiflash_scaler.go
Outdated
} else { | ||
doSet = true | ||
if deleteSlots.Has(ordinal) { | ||
actualDeleteSlots.Insert(ordinal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please help verify the cases in https://github.com/pingcap/tidb-operator/blob/master/pkg/manager/member/scaler_test.go#L343-L611?
And you have to enable the advanced statefulset to enable the deleteslots functionality, refer to https://docs.pingcap.com/zh/tidb-in-kubernetes/dev/advanced-statefulset.
Please also help verify the Kubernetes native statefulset cases.
Thanks!
@duduainankai Please help cover the following cases during the test:
|
@duduainankai Could you please join the slack channel of sig-k8s https://tidbcommunity.slack.com/archives/CHD0HA3LZ? |
I already joined the channel and you can find me by 'lizheming'. |
/run-all-tests |
0d756d0
to
966dfaa
Compare
@liubog2008: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-all-tests |
// ScaleInParallelism configures max scale in replicas for TiKV stores. | ||
// +kubebuilder:default=1 | ||
// +optional | ||
ScaleInParallelism *int32 `json:"scaleInParallelism,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it support negative number, how about adding a validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielZhangQD Should we treat 0
as an illegal argument too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
/run-all-tests |
/test pull-e2e-kind pull-e2e-kind-serial |
@lizhemingi could you please fix the CI? |
/test pull-e2e-kind pull-e2e-kind-serial |
Signed-off-by: Zheming Li <nkdudu@126.com>
e83e96f
to
a8d771c
Compare
Done. |
/run-all-test |
/run-all-tests |
// ScaleInParallelism configures max scale in replicas for TiKV stores. | ||
// +kubebuilder:default=1 | ||
// +optional | ||
ScaleInParallelism *int32 `json:"scaleInParallelism,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 3941104
|
I am very sorry that it took so long to finish the review of this PR due to our reasons. |
/test pull-e2e-kind pull-e2e-kind-br |
/test pull-e2e-kind |
Signed-off-by: Zheming Li nkdudu@126.com
What problem does this PR solve?
Closes #3849
What is changed and how does it work?
Scale in multi tikv store in one ScaleIn call.
Find as many as possible but no more than
spec.tikv.maxScaleInReplicas
inscaleMulti
.Try every possible ordinal found and aggregate all error to return.
Code changes
Tests
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.