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: initialize expensive query handler on domain creation #21340

Merged
merged 7 commits into from
Mar 11, 2021

Conversation

hanlins
Copy link
Contributor

@hanlins hanlins commented Nov 27, 2020

What problem does this PR solve?

Issue Number: close #18401

Problem Summary:

What is changed and how it works?

What's Changed:
Merge the expensive query handler initialization logic into the NewDomain function.

How it Works:

Originally the query execution handler is not initialized, thus LogOnQueryExceedMemQuota is a closure that accesses nil pointer. Now initialize query execution handler on Domain creation, so it won't access the nil pointer during bootstrap.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Performance regression
    NA
  • Breaking backward compatibility
    NA

Release note

  • Fix expensive query handler initialization during bootstrap

@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Nov 27, 2020
@CLAassistant
Copy link

CLAassistant commented Nov 27, 2020

CLA assistant check
All committers have signed the CLA.

@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2020

@hanlins
Copy link
Contributor Author

hanlins commented Nov 27, 2020

/rebuild

@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2020

@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Nov 27, 2020
@hanlins
Copy link
Contributor Author

hanlins commented Nov 27, 2020

/rebuild

@@ -388,19 +388,6 @@ func (s *testBootstrapSuite) TestOldPasswordUpgrade(c *C) {
c.Assert(newpwd, Equals, "*0D3CED9BEC10A777AEC23CCC353A8C08A633045E")
}

func (s *testBootstrapSuite) TestBootstrapInitExpensiveQueryHandle(c *C) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The InitExpensiveQueryHandle function is removed so I don't see the point testing against it. But maybe instead of removing the test, I could just remove InitExpensiveQueryHandle invocation and just check the existence of that query handler to avoid regression. Let me add that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@hanlins hanlins requested a review from xiongjiwei November 27, 2020 08:38
@ichn-hu ichn-hu mentioned this pull request Nov 27, 2020
@hanlins
Copy link
Contributor Author

hanlins commented Dec 2, 2020

/assign xiongjiwei

@xiongjiwei
Copy link
Contributor

@XuHuaiyu PTAL .

Copy link
Contributor

@wshwsh12 wshwsh12 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 Dec 23, 2020
@wshwsh12 wshwsh12 requested a review from XuHuaiyu December 23, 2020 07:58
@xiongjiwei xiongjiwei removed their assignment Dec 23, 2020
@xiongjiwei
Copy link
Contributor

/run-all-tests

1 similar comment
@hanlins
Copy link
Contributor Author

hanlins commented Jan 5, 2021

/run-all-tests

@hanlins
Copy link
Contributor Author

hanlins commented Jan 27, 2021

Hi @xiongjiwei @XuHuaiyu PTAL, thanks

Copy link
Contributor

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

  • xhebox

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 11, 2021
@xhebox
Copy link
Contributor

xhebox commented Mar 11, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 661d80eed0aa5034e2fef1a3f687759b7c96cea1

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2021
hanlins added 3 commits March 10, 2021 21:41
As query handler is being initialized during domain init, not need for
duplicated handler initialization.

Signed-off-by: Hanlin Shi <[email protected]>
Added expensive query handler existence check back to avoid potential
regression.

Signed-off-by: Hanlin Shi <[email protected]>
@hanlins hanlins force-pushed the fix/18401/query-handler-init branch from 600971a to e300469 Compare March 11, 2021 05:41
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 11, 2021
@hanlins hanlins requested a review from xhebox March 11, 2021 05:42
@xhebox
Copy link
Contributor

xhebox commented Mar 11, 2021

Are you changing anything?

@hanlins
Copy link
Contributor Author

hanlins commented Mar 11, 2021

Are you changing anything?

No change just rebase.

@xhebox
Copy link
Contributor

xhebox commented Mar 11, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: e300469

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

xhebox commented Mar 11, 2021

No change just rebase.

Bot will automatically merge the master branch. And the merge of PR will squash/rebase the commit history into the linear one. So you don't need to rebase unless there is a conflict or so.

@hanlins
Copy link
Contributor Author

hanlins commented Mar 11, 2021

Bot will automatically merge the master branch. And the merge of PR will squash/rebase the commit history into the linear one. So you don't need to rebase unless there is a conflict or so.

Got that, thanks!

@hanlins
Copy link
Contributor Author

hanlins commented Mar 11, 2021

/run-all-tests

@Rustin170506
Copy link
Member

/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.

@Rustin170506
Copy link
Member

Rustin170506 commented Mar 11, 2021

You can only trigger the failed test by /run-test-name.

@ti-chi-bot
Copy link
Member

@hanlins: 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.

@ti-chi-bot ti-chi-bot merged commit 67e4528 into pingcap:master Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. sig/sql-infra SIG: SQL Infra size/XS Denotes a PR that changes 0-9 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

memory_quota: tidb bootstrap failed
9 participants