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: do not record historical stats meta if the table is locked #57636

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Nov 22, 2024

What problem does this PR solve?

Issue Number: close #57628

Problem Summary:

What changed and how does it work?

We don't need to record the historical stats meta if the table is locked because all the information is stored in the locked tables.

So in this PR, we skip the record when the tables are locked.

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.

修复在 tidb_enable_historical_stats 开启并且锁定表统计信息的时候会出现的无效错误日志的问题
Fix the issue of invalid error logs that occur when `tidb_enable_historical_stats` is enabled and table statistics are locked

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 22, 2024
Signed-off-by: Rustin170506 <[email protected]>
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.6236%. Comparing base (14ff938) to head (b2e737a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57636        +/-   ##
================================================
+ Coverage   72.8292%   73.6236%   +0.7943%     
================================================
  Files          1676       1706        +30     
  Lines        463753     471794      +8041     
================================================
+ Hits         337748     347352      +9604     
+ Misses       105139     102973      -2166     
- Partials      20866      21469       +603     
Flag Coverage Δ
integration 46.2188% <0.0000%> (?)
unit 72.2042% <71.4285%> (-0.0203%) ⬇️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 45.4619% <ø> (+0.0240%) ⬆️
---- 🚨 Try these New Features:

Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@Rustin170506 Rustin170506 requested review from AilinKid, time-and-fate and winoros and removed request for AilinKid November 22, 2024 09:11
Copy link

ti-chi-bot bot commented Nov 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@ti-chi-bot ti-chi-bot bot added the approved label Nov 22, 2024
Copy link

ti-chi-bot bot commented Nov 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-22 13:12:06.700273283 +0000 UTC m=+210114.319927784: ☑️ agreed by winoros.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary error logs when table statistics are locked and tidb_enable_historical_stats is on
2 participants