Skip to content

Conversation

0xPoe
Copy link
Member

@0xPoe 0xPoe 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 74.9197%. Comparing base (14ff938) to head (b2e737a).
Report is 69 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57636        +/-   ##
================================================
+ Coverage   72.8292%   74.9197%   +2.0904%     
================================================
  Files          1676       1709        +33     
  Lines        463753     486259     +22506     
================================================
+ Hits         337748     364304     +26556     
+ Misses       105139     100699      -4440     
- Partials      20866      21256       +390     
Flag Coverage Δ
integration 47.6801% <0.0000%> (?)
unit 73.5996% <71.4285%> (+1.3751%) ⬆️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 46.5567% <ø> (+1.1189%) ⬆️

Copy link
Member Author

@0xPoe 0xPoe 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.)

@0xPoe 0xPoe requested review from AilinKid, time-and-fate and winoros and removed request for AilinKid November 22, 2024 09:11
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 22, 2024
Copy link

ti-chi-bot bot commented Dec 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: time-and-fate, 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 2, 2024
Copy link

ti-chi-bot bot commented Dec 2, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-22 13:12:06.700273283 +0000 UTC m=+210114.319927784: ☑️ agreed by winoros.
  • 2024-12-02 13:11:52.467016073 +0000 UTC m=+1074100.086670592: ☑️ agreed by time-and-fate.

@ti-chi-bot ti-chi-bot bot merged commit 5e73267 into pingcap:master Dec 2, 2024
25 checks passed
@0xPoe 0xPoe added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Dec 3, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 3, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 3, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

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. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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
4 participants