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

*: move config file options prepared-plan-cache.* to sysvars #34790

Merged
merged 16 commits into from
May 19, 2022

Conversation

qw4990
Copy link
Contributor

@qw4990 qw4990 commented May 18, 2022

What problem does this PR solve?

Issue Number: ref #33769, close #30168

Previous closing PR: #33836

Problem Summary:

The options prepared-plan-cache.* have historically been config options. But based on requirements from cloud & PM they should instead be sysvars.

What is changed and how it works?

Remove them from the config list and add them to global sysvars.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

The TiDB configuration file options `prepared-plan-cache-*` has been replaced by the system variables `tidb_enable_prepared_plan_cache`, `tidb_prepared_plan_cache_size`, and `tidb_prepared_plan_cache_memory_guard_ratio`. This change makes it easier to modify this setting on a cluster wide basis.

@qw4990 qw4990 requested a review from a team as a code owner May 18, 2022 14:34
@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 18, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bb7133
  • tiancaiamao

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 18, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2022
@qw4990
Copy link
Contributor Author

qw4990 commented May 18, 2022

#34752 was closed by some mistake, I submit a new PR for it. PTAL @bb7133 @tiancaiamao @morgo @CbcWestwolf

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 18, 2022
Comment on lines 665 to 667
if config.CheckTableBeforeDrop {
plannercore.SetPreparedPlanCache(true)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be reverted as soon as the sysvarcache is regenerated :(

plannercore.SetPreparedPlanCache() calls variable.PreparedPlanCacheSize.Store() without using the SQL interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only for tests, so it seems OK to use SetPreparedPlanCache here. I leave a comment there and plan to remove SetPreparedPlanCache in the next Sprint.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 19, 2022
@qw4990
Copy link
Contributor Author

qw4990 commented May 19, 2022

/run-all-tests

@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 May 19, 2022
@tiancaiamao
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 7dc77ce

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 19, 2022
@qw4990
Copy link
Contributor Author

qw4990 commented May 19, 2022

/run-mysql-test

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label May 19, 2022
@qw4990
Copy link
Contributor Author

qw4990 commented May 19, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 6cced75

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 19, 2022
@qw4990
Copy link
Contributor Author

qw4990 commented May 19, 2022

/rebuild

@sre-bot
Copy link
Contributor

sre-bot commented May 19, 2022

@ti-chi-bot ti-chi-bot merged commit 0cbccb7 into pingcap:master May 19, 2022
@sre-bot
Copy link
Contributor

sre-bot commented May 19, 2022

TiDB MergeCI notify

✅ Well Done! New fixed [1] after this pr merged.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci/integration-cdc-test ✅ all 34 tests passed 27 min Fixed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 11 tests passed 13 min Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 9 min 45 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 7 min 49 sec Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 7 min 7 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 7 min 6 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 7 min 0 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 6 min 59 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 2 min 58 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Introduce a new global variable as the switch for Plan Cache
6 participants