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) #48362

Merged

Conversation

ti-chi-bot
Copy link
Member

@ti-chi-bot ti-chi-bot commented Nov 7, 2023

This is an automated cherry-pick of #48284

What problem does this PR solve?

Issue Number: ref: #48281 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>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@ti-chi-bot ti-chi-bot added 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Nov 7, 2023
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 7, 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 7, 2023
Copy link

ti-chi-bot bot commented Nov 7, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-07 09:14:46.727255553 +0000 UTC m=+3549284.314365698: ☑️ agreed by crazycs520.
  • 2023-11-07 09:15:42.609574004 +0000 UTC m=+3549340.196684130: ☑️ agreed by lcwangchao.

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Nov 7, 2023
Copy link

ti-chi-bot bot commented Nov 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crazycs520, 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 7, 2023
@ti-chi-bot ti-chi-bot bot merged commit 984d8c9 into pingcap:release-7.5 Nov 7, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants