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

statistics: stop loading too many stats when to init stats #53999

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Jun 13, 2024

What problem does this PR solve?

Issue Number: close #54000

Problem Summary:

What changed and how does it work?

Check List

Tests

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

with 1 millions tables, tidb disable lite-init-stats.

before

image

after

image

sync load can find needed-load stats and evict stats when too many stats is in the cache.

image
  • 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 do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked labels Jun 13, 2024
@hawkingrei
Copy link
Member Author

/retest

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 51.51515% with 32 lines in your changes missing coverage. Please review.

Project coverage is 56.5508%. Comparing base (29fc940) to head (01de37c).
Report is 15 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53999         +/-   ##
=================================================
- Coverage   72.4718%   56.5508%   -15.9210%     
=================================================
  Files          1508       1638        +130     
  Lines        432045     611833     +179788     
=================================================
+ Hits         313111     345997      +32886     
- Misses        99516     242638     +143122     
- Partials      19418      23198       +3780     
Flag Coverage Δ
integration 37.6899% <0.0000%> (?)
unit 72.0788% <51.5151%> (+0.6162%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (+0.0188%) ⬆️
parser ∅ <ø> (∅)
br 51.1583% <ø> (+8.9091%) ⬆️

@hawkingrei
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei force-pushed the not_load_stats_after_lfu_full branch from c7a7972 to 2735d9e Compare June 13, 2024 10:36
@ti-chi-bot ti-chi-bot 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 Jun 13, 2024
@hawkingrei hawkingrei force-pushed the not_load_stats_after_lfu_full branch from 650aa8f to adf9a53 Compare June 14, 2024 02:49
@hawkingrei hawkingrei force-pushed the not_load_stats_after_lfu_full branch from adf9a53 to 91bfa52 Compare June 14, 2024 08:05
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei force-pushed the not_load_stats_after_lfu_full branch from 9de21fe to 01de37c Compare June 14, 2024 14:06
@hawkingrei hawkingrei requested a review from winoros June 14, 2024 14:15
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 17, 2024
@hawkingrei hawkingrei requested a review from AilinKid June 18, 2024 02:34
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 18, 2024
Copy link

ti-chi-bot bot commented Jun 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-17 12:50:05.721873903 +0000 UTC m=+32732.207362727: ☑️ agreed by winoros.
  • 2024-06-18 03:19:40.035169814 +0000 UTC m=+84906.520658647: ☑️ agreed by AilinKid.

Copy link

ti-chi-bot bot commented Jun 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, winoros

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

@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 2cea994 into pingcap:master Jun 18, 2024
23 checks passed
@hawkingrei
Copy link
Member Author

/cherrypick release-7.5
/cherrypick release-8.1

@hawkingrei hawkingrei deleted the not_load_stats_after_lfu_full branch June 19, 2024 07:43
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.5: #54104.

In response to this:

/cherrypick release-7.5
/cherrypick release-8.1

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 pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 19, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 19, 2024
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-8.1: #54105.

In response to this:

/cherrypick release-7.5
/cherrypick release-8.1

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.

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.

stop loading stats when has too much stats in the memory during the init stats
4 participants