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: delete old partition's stats meta after removing partitioning #49553

Merged
merged 11 commits into from
Dec 19, 2023

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Dec 18, 2023

What problem does this PR solve?

Issue Number: close #49547

Problem Summary:

What changed and how does it work?

  • Added some tests to cover the issue case.
  • Drop the old partition's stats meta.
  • Added old table ID to the event to avoid abuse of the new table ID from partition info.

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.

Fix TiDB cannot delete old partition's stats meta after changing partitioned tables to non-partitioned tables

@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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 18, 2023
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Merging #49553 (51ab22c) into master (ad1efe4) will increase coverage by 0.4606%.
Report is 1 commits behind head on master.
The diff coverage is 41.3793%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49553        +/-   ##
================================================
+ Coverage   71.0028%   71.4634%   +0.4606%     
================================================
  Files          1368       1421        +53     
  Lines        399204     415727     +16523     
================================================
+ Hits         283446     297093     +13647     
- Misses        95973      99835      +3862     
+ Partials      19785      18799       -986     
Flag Coverage Δ
integration 43.6561% <41.3793%> (?)
unit 71.0027% <ø> (-0.0001%) ⬇️

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

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.3644% <ø> (-5.5178%) ⬇️

@Rustin170506 Rustin170506 force-pushed the rustin-patch-partitioning branch from def1e3b to a4973bb Compare December 18, 2023 09:29
pkg/ddl/partition.go Outdated Show resolved Hide resolved
Rustin170506 and others added 2 commits December 19, 2023 11:07
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

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 19, 2023
Copy link

ti-chi-bot bot commented Dec 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

ti-chi-bot bot commented Dec 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-19 04:50:49.549100727 +0000 UTC m=+936540.586327653: ☑️ agreed by time-and-fate.
  • 2023-12-19 12:15:33.828187246 +0000 UTC m=+963224.865414175: ☑️ agreed by zimulala.

@ti-chi-bot ti-chi-bot bot merged commit 8bebe44 into pingcap:master Dec 19, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/statistics lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
3 participants