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 extended stats cache item in current tidb synchronously #23088

Merged
merged 4 commits into from
Mar 12, 2021

Conversation

eurekaka
Copy link
Contributor

@eurekaka eurekaka commented Mar 3, 2021

What problem does this PR solve?

Issue Number: close #23065

Problem Summary:

Not a problem, change the extended stats removal to a more intuitive behavior.

What is changed and how it works?

What's Changed:

  • add minorVersion for statsCache, and check it when updating stats cache;
  • remove extended stats cache item in alter table drop stats_extended;

Related changes

N/A

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • Delete extended stats cache item in current tidb synchronously

@eurekaka eurekaka added type/enhancement The issue or PR belongs to an enhancement. component/statistics labels Mar 3, 2021
@eurekaka eurekaka requested review from qw4990 and time-and-fate March 3, 2021 11:50
@eurekaka eurekaka requested a review from a team as a code owner March 3, 2021 11:50
@eurekaka eurekaka requested review from winoros and removed request for a team March 3, 2021 11:50
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 3, 2021
@eurekaka eurekaka force-pushed the remove_cache branch 2 times, most recently from 98c21a4 to 50bec48 Compare March 4, 2021 07:21
statistics/handle/handle.go Outdated Show resolved Hide resolved
@eurekaka eurekaka requested a review from qw4990 March 8, 2021 06:28
@eurekaka
Copy link
Contributor Author

eurekaka commented Mar 9, 2021

@qw4990 @winoros I have added more comments for the minorVersion, PTAL.

@time-and-fate
Copy link
Member

(h *Handle) UpdateErrorRate and (h *Handle) UpdateStatsByLocalFeedback also used updateStatsCache() without version bump, seems they also need modified?

@eurekaka
Copy link
Contributor Author

eurekaka commented Mar 9, 2021

/run-check_dev_2

@eurekaka
Copy link
Contributor Author

eurekaka commented Mar 9, 2021

(h *Handle) UpdateErrorRate and (h *Handle) UpdateStatsByLocalFeedback also used updateStatsCache() without version bump, seems they also need modified?

https://github.com/pingcap/tidb/pull/23088/files#diff-0328ab2b93ceecc70da3d30ab5b65ba92089d7f7082ac22880811f70e2a93acaR608 already updated.

statistics/handle/handle.go Outdated Show resolved Hide resolved
statistics/handle/handle.go Show resolved Hide resolved
Copy link
Member

@time-and-fate time-and-fate left a comment

Choose a reason for hiding this comment

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

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 10, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qw4990
  • time-and-fate

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 12, 2021
@qw4990
Copy link
Contributor

qw4990 commented Mar 12, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 6a436de

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 12, 2021
@qw4990
Copy link
Contributor

qw4990 commented Mar 12, 2021

/merge

@eurekaka
Copy link
Contributor Author

/run-unit-test

@ti-chi-bot
Copy link
Member

@eurekaka: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@eurekaka
Copy link
Contributor Author

/run-check_dev_2

@ti-chi-bot ti-chi-bot merged commit 6d258c7 into pingcap:master Mar 12, 2021
@eurekaka eurekaka deleted the remove_cache branch March 12, 2021 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

delete extended stats cache item in current tidb synchronously for alter table drop stats_extended
5 participants