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

[UCP] Noise reduction support when cluster auto scaling (#2307) #2568

Merged
merged 3 commits into from
May 29, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented May 27, 2020

cherry-pick #2307 to release-1.1


What problem does this PR solve?

UCP #2241

What is changed and how does it work?

Add Phrase for TidbClusterAutoScaler, it has three optional values: Normal, ReadyToScaleOut, ReadyToScaleIn.
Add user defined autoscale threshold.

use tidb as an example, tikv should be the same.

  1. check phase
    after autoscaler calculate the target replica, if target replica equals to current replica, set auto scaler phase to normal and return, otherwise check if the phase equal to scaleOut or scaleIn, if not, update the phase and record timestamp. go to 2.

  2. check timestamp threshold
    check the record timestamp remains longer than threshold which user defined. If not, return, otherwise go to 3.

  3. do autoscale
    set phase to normal and do normal autoscale.

Design for e2e tests:
After mock response from Prometheus, without noise reduction, it will start auto scaling after maximum 30s, but with noise reduction, we expect at least in 300s (ReadyToScaleThresholdSeconds),
cluster should remain the replica number. And after ReadyToScaleThresholdSeconds time, the cluster should start normal auto scaling and auto scale phase should be back to normal.

Check List

Tests

  • Unit test
  • E2E test

Code changes

  • Has Go code change

Side effects

n/a

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Does this PR introduce a user-facing change?:

User now can specify `ReadyToScaleThresholdSeconds` in `TidbClusterAutoScaler`, until cluster keep in ready to auto scale status for `ReadyToScaleThresholdSeconds` seconds, then cluster start auto scaling.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@DanielZhangQD
Copy link
Contributor

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented May 27, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented May 27, 2020

@sre-bot merge failed.

@Yisaer
Copy link
Contributor

Yisaer commented May 27, 2020

We would bring this to the minor version after 1.1 GA releases.

@Yisaer
Copy link
Contributor

Yisaer commented May 29, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented May 29, 2020

/run-all-tests

@DanielZhangQD DanielZhangQD modified the milestones: v1.1.0-rc.4, v1.1.1 May 29, 2020
@sre-bot sre-bot merged commit 4090243 into pingcap:release-1.1 May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants