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: merge global stats even if some partition stats are missing #41176

Merged
merged 10 commits into from
Jul 26, 2023

Conversation

xuyifangreeneyes
Copy link
Contributor

@xuyifangreeneyes xuyifangreeneyes commented Feb 7, 2023

What problem does this PR solve?

Issue Number: ref #38999

Problem Summary:

What is changed and how it works?

Introduce a system variable tidb_skip_missing_partition_stats, whose default value is on. If tidb_skip_missing_partition_stats turns on, merging global stats would skip partitions whose stats are missing rather than fail.

Check List

Tests

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

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

@xuyifangreeneyes xuyifangreeneyes requested a review from a team as a code owner February 7, 2023 17:40
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 7, 2023
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2023
@hawkingrei
Copy link
Member

@xuyifangreeneyes Please fix the conflict.

@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
Copy link
Contributor

@chrysan chrysan left a comment

Choose a reason for hiding this comment

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

please add tests

return
}
if allPartitionStats == nil {
allPartitionStats = make(map[int64]*statistics.Table)
}
allPartitionStats[partitionID] = partitionStats
}
globalStats.Count += partitionStats.Count
globalStats.ModifyCount += partitionStats.ModifyCount
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to remove the count adding later in this func?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It is a mistake I made when resolving conflicts.

@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 10, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Attention: Patch coverage is 65.88235% with 29 lines in your changes missing coverage. Please review.

Project coverage is 73.2481%. Comparing base (c0459da) to head (cf303f7).
Report is 3847 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #41176        +/-   ##
================================================
+ Coverage   73.2404%   73.2481%   +0.0076%     
================================================
  Files          1267       1270         +3     
  Lines        389943     390679       +736     
================================================
+ Hits         285596     286165       +569     
- Misses        86048      86170       +122     
- Partials      18299      18344        +45     
Flag Coverage Δ
integration 78.1388% <ø> (?)
unit 73.2396% <65.8823%> (-0.0009%) ⬇️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0663% <ø> (+0.0109%) ⬆️
br 52.1472% <ø> (+0.0462%) ⬆️

@xuyifangreeneyes
Copy link
Contributor Author

/test check-dev

@tiprow
Copy link

tiprow bot commented Jul 26, 2023

@xuyifangreeneyes: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test check-dev

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 kubernetes/test-infra repository.

@xuyifangreeneyes
Copy link
Contributor Author

/test build

@tiprow
Copy link

tiprow bot commented Jul 26, 2023

@xuyifangreeneyes: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test build

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 kubernetes/test-infra repository.

@xuyifangreeneyes
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrysan, hawkingrei, qw4990

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:
  • OWNERS [chrysan,hawkingrei,qw4990]

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
Copy link

ti-chi-bot bot commented Jul 26, 2023

@xuyifangreeneyes: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test cf303f7 link unknown /test unit-test

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

@xuyifangreeneyes
Copy link
Contributor Author

/test unit-test

@tiprow
Copy link

tiprow bot commented Jul 26, 2023

@xuyifangreeneyes: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test unit-test

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit a492a37 into pingcap:master Jul 26, 2023
6 of 9 checks passed
@Rustin170506 Rustin170506 added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Dec 14, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 14, 2023
hawkingrei pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 24, 2024
hawkingrei pushed a commit to ti-chi-bot/tidb that referenced this pull request Sep 3, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 28, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tidb#release-7.1 from head ti-chi-bot:cherry-pick-41176-to-release-7.1: the GitHub API request returns a 403 error: {"message":"You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. If you reach out to GitHub Support for help, please include the request ID ACA6:3F108B:1B81993:33D55A3:671F467B and timestamp 2024-10-28 08:08:27 UTC.","documentation_url":"https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits","status":"403"}

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 28, 2024
@AilinKid AilinKid removed the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Nov 5, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Nov 5, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 5, 2024
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-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. 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.

7 participants