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: add new variables for instance plan cache #55193

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

qw4990
Copy link
Contributor

@qw4990 qw4990 commented Aug 5, 2024

What problem does this PR solve?

Issue Number: ref #54057

Problem Summary: planner: add new variables for instance plan cache

What changed and how does it work?

Add three new variables for the instance level plan cache:

  1. tidb_enable_instance_plan_cache: whether to enable this feature;
  2. tidb_instance_plan_cache_target_mem_size: the target memory limit (or soft mem limit) of the cache;
  3. tidb_instance_plan_cache_max_mem_size: the max memory limit (or hard mem limit) of the cache;

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 5, 2024
Copy link

tiprow bot commented Aug 5, 2024

Hi @qw4990. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 88.46154% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.0323%. Comparing base (f3e153a) to head (3048f95).
Report is 5 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55193        +/-   ##
================================================
- Coverage   74.8430%   74.0323%   -0.8107%     
================================================
  Files          1568       1569         +1     
  Lines        364503     441473     +76970     
================================================
+ Hits         272805     326833     +54028     
- Misses        71976      94292     +22316     
- Partials      19722      20348       +626     
Flag Coverage Δ
integration 24.9815% <36.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (-2.2327%) ⬇️
parser ∅ <ø> (∅)
br 54.4383% <ø> (+6.7376%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 5, 2024
@easonn7
Copy link

easonn7 commented Aug 5, 2024

/approve

return strconv.FormatInt(InstancePlanCacheTargetMemSize.Load(), 10), nil
},
SetGlobal: func(_ context.Context, s *SessionVars, val string) error {
v, err := strconv.ParseInt(val, 10, 64)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to consider using TidbOptInt64? I see that many variables are directly set to the default value when the error occurs, and I wonder whether these two variables are considered to be treated the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. PTAL

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Aug 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, time-and-fate, zimulala

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 6, 2024
Copy link

ti-chi-bot bot commented Aug 6, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-05 10:38:03.585799675 +0000 UTC m=+262013.452898763: ☑️ agreed by time-and-fate.
  • 2024-08-06 02:09:12.736736232 +0000 UTC m=+317882.603835315: ☑️ agreed by zimulala.

@ti-chi-bot ti-chi-bot bot merged commit d383367 into pingcap:master Aug 6, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants