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

executor: store correct plan hint in statements_summary when log level is 'debug' #22219

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

eurekaka
Copy link
Contributor

@eurekaka eurekaka commented Jan 6, 2021

What problem does this PR solve?

Issue Number: close #22203

Problem Summary:

Baseline capture does not work as expected.

What is changed and how it works?

What's Changed:

Make sure planHint is correctly set in statements_summary when the log level is debug or the tidb_slow_log_threshold is set to 0.

How it Works:

getEncodedPlan may be called in LogSlowQuery which would only generate encoded plan(i.e, with no plan hint), we should make sure the consequent getEncodedPlan call in SummaryStmt can generate plan hint then.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test: set log level to debug, or tidb_slow_log_threshold to 0 and execute the queries in the issue, binding is successfully captured.

Side effects

N/A

Release note

  • Make baseline capture work when log level is 'debug'

Copy link
Contributor

@Reminiscent Reminiscent 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 7, 2021
@ichn-hu ichn-hu mentioned this pull request Jan 7, 2021
Copy link
Contributor

@qw4990 qw4990 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-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 8, 2021
@qw4990
Copy link
Contributor

qw4990 commented Jan 8, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 8, 2021
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@eurekaka merge failed.

@qw4990
Copy link
Contributor

qw4990 commented Jan 8, 2021

/run-tics-test

@qw4990 qw4990 merged commit fe9d316 into pingcap:master Jan 8, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jan 8, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #22293

@eurekaka eurekaka deleted the debug_capture branch January 8, 2021 06:26
qw4990 pushed a commit that referenced this pull request Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/sql-plan-management sig/execution SIG execution sig/planner SIG: Planner 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.

SPM: the regression issue of capturing baseline failure
4 participants