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: make exponential backoff estimation more safe #23086

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

winoros
Copy link
Member

@winoros winoros commented Mar 3, 2021

What problem does this PR solve?

Issue Number: close #23059

Problem Summary:

In the mentioned issue, the exp backoff est meets the case that there are no matched stats. So the original code will panic since the default logic branch is for length=4.

What is changed and how it works?

The default branch is length==0 instead.

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

  • No release note

@winoros winoros added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Mar 3, 2021
@winoros winoros requested review from qw4990 and time-and-fate March 3, 2021 10:55
@winoros winoros requested a review from a team as a code owner March 3, 2021 10:55
@winoros winoros requested review from hanfei1991 and removed request for a team March 3, 2021 10:55
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 3, 2021
@@ -24,6 +24,10 @@
[
"IndexReader_6 1.36 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 1.36 cop[tikv] table:exp_backoff, index:idx(a, b, c, d) range:[1 1 1 3,1 1 1 5], keep order:false"
],
[
"IndexReader_6 0.00 root index:IndexRangeScan_5",
Copy link
Member Author

Choose a reason for hiding this comment

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

It's actually zero data.

@winoros winoros removed the request for review from hanfei1991 March 3, 2021 11:02
@qw4990
Copy link
Contributor

qw4990 commented Mar 3, 2021

/LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 3, 2021
@winoros winoros force-pushed the expbackoff-more-safe branch from 8cb0c2b to e97ceae Compare March 3, 2021 12:17
@ichn-hu ichn-hu mentioned this pull request Mar 3, 2021
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
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 3, 2021
@winoros
Copy link
Member Author

winoros commented Mar 3, 2021

/merge

@ti-chi-bot
Copy link
Member

@winoros: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

@ti-chi-bot
Copy link
Member

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

Commit hash: e97ceae

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

@winoros: 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

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.

@ti-chi-bot ti-chi-bot merged commit 263155a into pingcap:master Mar 4, 2021
@winoros winoros deleted the expbackoff-more-safe branch March 4, 2021 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 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/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiDB reported out-of-range error while tidb_analyze_version = 2
4 participants