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

planner: ban baseline evolution feature #26333

Merged
merged 21 commits into from
Aug 5, 2021

Conversation

Reminiscent
Copy link
Contributor

@Reminiscent Reminiscent commented Jul 19, 2021

What problem does this PR solve?

Issue Number: close issue#26330

Problem Summary:
Ban the baseline evolution feature before the feature is GA.

What is changed and how it works?

  1. When we set the system variable tidb_evolve_plan_baselines it will report an error.
  2. When we execute admin evolve bindings, it will report an error.

Check List

Tests

  • Unit test

Documentation

  • Affects user behaviors

Release note

  • Ban baseline evolution feature until the feature is GA.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 19, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • eurekaka
  • qw4990

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2021
@Reminiscent
Copy link
Contributor Author

/label sig/planner

@ti-chi-bot
Copy link
Member

@Reminiscent: The label(s) sig/planner cannot be applied. These labels are supported: CHANGELOG, challenge-program, compatibility-breaker, contribution, correctness, first-time-contributor, good-first-issue, hacktoberfest, high-performance, hptc, need-more-info, needs-cherry-pick-3.0, needs-cherry-pick-3.1, needs-cherry-pick-4.0, needs-cherry-pick-5.0, needs-cherry-pick-5.1, proposal, release-note, require-LGT3, security, tools.

In response to this:

/label sig/planner

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.

@github-actions github-actions bot added sig/execution SIG execution sig/planner SIG: Planner labels Jul 19, 2021
@Reminiscent
Copy link
Contributor Author

/cc @eurekaka

@ti-chi-bot ti-chi-bot requested a review from eurekaka July 19, 2021 06:46
@Reminiscent
Copy link
Contributor Author

/rebuild

@eurekaka
Copy link
Contributor

eurekaka commented Aug 2, 2021

/label epic/sql-plan-management

@ti-chi-bot
Copy link
Member

@eurekaka: The label(s) epic/sql-plan-management cannot be applied. These labels are supported: CHANGELOG, challenge-program, compatibility-breaker, contribution, correctness, first-time-contributor, good-first-issue, hacktoberfest, high-performance, hptc, need-more-info, needs-cherry-pick-3.0, needs-cherry-pick-3.1, needs-cherry-pick-4.0, needs-cherry-pick-5.0, needs-cherry-pick-5.1, proposal, release-note, require-LGT3, security, tools.

In response to this:

/label epic/sql-plan-management

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.

@Reminiscent Reminiscent mentioned this pull request Aug 2, 2021
12 tasks
executor/set.go Outdated
@@ -108,6 +109,10 @@ func (e *SetExecutor) setSysVariable(ctx context.Context, name string, v *expres
if sysVar == nil {
return variable.ErrUnknownSystemVar.GenWithStackByArgs(name)
}
// The 'baseline evolution' only work in the CI environment before the feature is GA.
if sysVar.Name == "tidb_evolve_plan_baselines" && !config.CheckTableBeforeDrop {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should check the target value is on before reporting error, otherwise, if the users have already enabled this feature, they cannot disable the feature anymore.

executor/set.go Outdated
@@ -108,6 +109,10 @@ func (e *SetExecutor) setSysVariable(ctx context.Context, name string, v *expres
if sysVar == nil {
return variable.ErrUnknownSystemVar.GenWithStackByArgs(name)
}
// The 'baseline evolution' only work in the CI environment before the feature is GA.
if sysVar.Name == "tidb_evolve_plan_baselines" && !config.CheckTableBeforeDrop {
return errors.Errorf("The 'baseline evolution' of TiDB has not been GA yet, so it is forbidden to use it.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return errors.Errorf("The 'baseline evolution' of TiDB has not been GA yet, so it is forbidden to use it.")
return errors.Errorf("Cannot enable baseline evolution feature, it is not generally available now")

@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 3, 2021
@Reminiscent
Copy link
Contributor Author

@eurekaka Update. PTAL

@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Aug 3, 2021
@@ -1143,6 +1143,9 @@ func (s *session) SetGlobalSysVar(name, value string) (err error) {
if value, err = sv.Validate(s.sessionVars, value, variable.ScopeGlobal); err != nil {
return err
}
if sv.Name == "tidb_evolve_plan_baselines" && strings.EqualFold("ON", value) && !config.CheckTableBeforeDrop {
Copy link
Contributor

Choose a reason for hiding this comment

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

And are sv.Name and value standardized here? What if tidb_EVOLVE_plan_baselines or on?

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 4, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 4, 2021
@Reminiscent
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 0a8ef1e

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 4, 2021
@Reminiscent
Copy link
Contributor Author

/run-all-tests

1 similar comment
@Reminiscent
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Aug 5, 2021
@Reminiscent
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 9c6f681

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 5, 2021
@ti-chi-bot
Copy link
Member

@Reminiscent: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@ti-chi-bot ti-chi-bot merged commit bfbe67d into pingcap:master Aug 5, 2021
@Reminiscent Reminiscent deleted the forbidBaselineEvolution branch August 5, 2021 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/sql-plan-management sig/execution SIG execution sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ban baseline evolution feature
4 participants