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

infoschema: refine info cache logic to reduce the impact of DDL on information schema cache #48284

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Nov 3, 2023

What problem does this PR solve?

Issue Number: close #48285

Problem Summary: refine info cache logic to reduce the impact of DDL on information schema cache

What is changed and how it works?

Do same test in #48285, with this PR, the impact of failed to get schema version to stale read QPS is much smaller.

[2023/11/04 09:44:04.794 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3234]
[2023/11/04 09:44:18.787 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3280]
[2023/11/04 09:44:20.885 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3281]
[2023/11/04 09:44:37.502 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3332]
[2023/11/04 09:44:48.265 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3363]
[2023/11/04 09:45:10.305 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3431]
[2023/11/04 09:45:34.291 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3499]
[2023/11/04 09:45:45.170 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3531]
[2023/11/04 09:46:12.471 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3612]
[2023/11/04 09:46:20.786 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3638]
[2023/11/04 09:46:24.319 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3648]
[2023/11/04 09:46:26.283 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3655]
[2023/11/04 09:46:45.023 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3708]
[2023/11/04 09:46:50.798 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3728]
[2023/11/04 09:47:12.034 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3785]
[2023/11/04 09:47:39.571 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3869]
[2023/11/04 09:47:45.348 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=3888]
[2023/11/04 09:49:10.819 +08:00] [WARN] [domain.go:196] ["failed to get schema version"] [error="There is no Write MVCC info for the schema version"] [version=4136]

The the related metric is following, as you can see, the QPS is much more stable and load snapshot ops is much lower.

image

Before This PR

image

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

Signed-off-by: crazycs520 <crazycs520@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 3, 2023
Copy link

tiprow bot commented Nov 3, 2023

Hi @crazycs520. 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/test-infra repository.

@crazycs520
Copy link
Contributor Author

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Nov 3, 2023
@crazycs520
Copy link
Contributor Author

@lcwangchao @cfzjywxk PTAL

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #48284 (254584c) into master (d2c0c6e) will increase coverage by 1.5732%.
Report is 11 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48284        +/-   ##
================================================
+ Coverage   71.4920%   73.0652%   +1.5732%     
================================================
  Files          1402       1425        +23     
  Lines        406343     416121      +9778     
================================================
+ Hits         290503     304040     +13537     
+ Misses        96004      93139      -2865     
+ Partials      19836      18942       -894     
Flag Coverage Δ
integration 43.2699% <91.6666%> (?)
unit 71.7074% <100.0000%> (+0.2154%) ⬆️

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 49.0945% <ø> (-3.8235%) ⬇️

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520 crazycs520 changed the title infoschema: refine info cache logic infoschema: refine info cache logic to reduce the impact of DDL on information schema cache Nov 6, 2023
@crazycs520
Copy link
Contributor Author

/retest-required

Copy link
Collaborator

@lcwangchao lcwangchao left a comment

Choose a reason for hiding this comment

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

LGTM. Please add more comments

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 6, 2023
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 6, 2023
Copy link

ti-chi-bot bot commented Nov 6, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-06 03:30:15.507982636 +0000 UTC m=+3442213.095092779: ☑️ agreed by lcwangchao.
  • 2023-11-06 03:39:43.954528558 +0000 UTC m=+3442781.541638702: ☑️ agreed by cfzjywxk.

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Nov 6, 2023

/cc @zimulala @wjhuang2016 @tangenta PTAL

Copy link

ti-chi-bot bot commented Nov 6, 2023

@cfzjywxk: GitHub didn't allow me to request PR reviews from the following users: PTAL.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @zimulala @wjhuang2016 @tangenta PTAL

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/test-infra repository.

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Copy link

ti-chi-bot bot commented Nov 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, lcwangchao, 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 the approved label Nov 6, 2023
@hawkingrei
Copy link
Member

/retest

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Nov 6, 2023

/retest-required

@hawkingrei
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit 4ae5622 into pingcap:master Nov 6, 2023
15 of 16 checks passed
@crazycs520 crazycs520 added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Nov 7, 2023
@crazycs520 crazycs520 deleted the refine-info-cache-master branch November 7, 2023 09:00
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #48362.

ti-chi-bot bot pushed a commit that referenced this pull request Nov 7, 2023
crazycs520 added a commit to ti-chi-bot/tidb that referenced this pull request May 27, 2024
…formation schema cache (pingcap#48284)

close pingcap#48285

Signed-off-by: crazycs520 <crazycs520@gmail.com>
crazycs520 added a commit to ti-chi-bot/tidb that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. 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.

refine information schema cache
6 participants