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,sessionctx: add correctness for system variables #12311

Merged
merged 4 commits into from
Oct 8, 2019

Conversation

xiaoronglv
Copy link

What problem does this PR solve?

For MySQL, thread_pool_size is the number of thread groups, which determine how many queries can execute simultaneously.

This commit is to add constraints for global variable thread_pool_size for TiDB, which is a subtask of epic Complete correctness for system.

What is changed and how it works?

Add restriction for global variable thread_pool_size, of which

  • the value must be equal or greater than 1
  • the value must be equal or less than 64

Check List

Tests

  • Unit test

Code changes

  • Has exported variable/fields change

Side effects

  • Possible performance regression
  • Increased code complexity

## What

Add restriction for system variable `thread_pool_size`.

## Reference

1. [MySQL global variable: thread_pool_size](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_version_compile_os)
2. [TiDB guide to cover more restrictions on system variable  ](pingcap#7195)
@CLAassistant
Copy link

CLAassistant commented Sep 23, 2019

CLA assistant check
All committers have signed the CLA.

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Sep 23, 2019
@xiaoronglv xiaoronglv changed the title executor,sessionctx: Add correctness for system variables: thread_pool_size Add correctness for system variables: thread_pool_size Sep 23, 2019
@xiaoronglv
Copy link
Author

Hi @spongedu @djshow832 Could you please help to review my code?

Thanks!

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/LGT1 Indicates that a PR has LGTM 1. type/enhancement The issue or PR belongs to an enhancement. needs-cherry-pick-2.1 labels Sep 24, 2019
@zz-jason
Copy link
Member

@xiaoronglv Thanks for your contribution, please follow the Commit Message and Pull Request Style to reformat the PR title.

@xiaoronglv xiaoronglv changed the title Add correctness for system variables: thread_pool_size executor,sessionctx: add correctness for system variables Sep 24, 2019
@xiaoronglv
Copy link
Author

Hi, @zz-jason

Thanks for your review. I have changed the title based on your review.

@qw4990 qw4990 removed their request for review September 26, 2019 07:20
@zz-jason zz-jason requested a review from SunRunAway October 8, 2019 06:57
@xiaoronglv
Copy link
Author

Hi @zz-jason @SunRunAway

This pr has been pending for days. Could you please merge it?

Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM.

@SunRunAway SunRunAway added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 8, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

@xiaoronglv merge failed.

@xiaoronglv
Copy link
Author

I am checking the failing test, will fix it soon.

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #12311 into master will increase coverage by 0.065%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##             master     #12311       +/-   ##
===============================================
+ Coverage   79.8891%   79.9541%   +0.065%     
===============================================
  Files           460        461        +1     
  Lines        102636     103403      +767     
===============================================
+ Hits          81995      82675      +680     
- Misses        14677      14751       +74     
- Partials       5964       5977       +13

@lance6716
Copy link
Contributor

/run-all-tests

@xiaoronglv
Copy link
Author

xiaoronglv commented Oct 8, 2019

@SunRunAway

it seems the hosts, which are used to run test framework, are not stable. That caused test failed.

https://internal.pingcap.net/idc-jenkins/blue/rest/organizations/jenkins/pipelines/tidb_ghpr_unit_test/runs/8952/nodes/66/steps/152/log/?start=0

[2019-10-08T07:18:24.741Z] FAIL: helper_test.go:63: HelperTestSuite.SetUpSuite
[2019-10-08T07:18:24.741Z] 
[2019-10-08T07:18:24.741Z] helper_test.go:136:
[2019-10-08T07:18:24.741Z]     c.Assert(err, IsNil)
[2019-10-08T07:18:24.741Z] ... value *net.OpError = &net.OpError{Op:"listen", Net:"tcp", Source:net.Addr(nil), Addr:(*net.TCPAddr)(0xc0002ad7a0), Err:(*os.SyscallError)(0xc000253a40)} ("listen tcp 127.0.0.1:10100: bind: address already in use")
[2019-10-08T07:18:24.741Z] 
[2019-10-08T07:18:24.741Z] 
[2019-10-08T07:18:24.741Z] ----------------------------------------------------------------------
[2019-10-08T07:18:24.741Z] MISS: helper_test.go:97: HelperTestSuite.TestGetRegionsTableInfo
[2019-10-08T07:18:24.741Z] MISS: helper_test.go:75: HelperTestSuite.TestHotRegion
[2019-10-08T07:18:24.741Z] MISS: helper_test.go:105: HelperTestSuite.TestTiKVRegionsInfo
[2019-10-08T07:18:24.741Z] MISS: helper_test.go:115: HelperTestSuite.TestTiKVStoresStat
[2019-10-08T07:18:24.741Z] OOPS: 0 passed, 1 FAILED, 4 MISSED

@lance6716
Copy link
Contributor

/run-all-tests

@xiaoronglv
Copy link
Author

@lance6716 Thanks for your help.

@zz-jason zz-jason merged commit 3e8129d into pingcap:master Oct 8, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

cherry pick to release-3.0 failed

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

cherry pick to release-3.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

cherry pick to release-2.1 failed

@zz-jason
Copy link
Member

@xiaoronglv Could you help us cherry-pick this commit to the release-2.1, release-3.0 and release-3.1 branches?

@xiaoronglv
Copy link
Author

Hi @zz-jason ,

sure, I can do it manually.

xiaoronglv pushed a commit to xiaoronglv/tidb that referenced this pull request Oct 10, 2019
xiaoronglv pushed a commit to xiaoronglv/tidb that referenced this pull request Oct 10, 2019
xiaoronglv pushed a commit to xiaoronglv/tidb that referenced this pull request Oct 10, 2019
@xiaoronglv
Copy link
Author

Hi @zz-jason

As you requested, I manually cherry pick this commit from master to the following branches

release-2.1 failed to pick this commit due to missing some key commits, which are not cherry picked before.

d381d84d1b

Regarding this commit, can we ignore release-2.1?

If the answer is yes, I am going to close PR for release-2.1

@zz-jason
Copy link
Member

Seems we missed some commits which should be cherry picked to release-2.1 as well 😂 @spongedu Could you help us cherry pick #11239 to release-2.1?

@zz-jason
Copy link
Member

There might be other session variable validation PRs not cherry picked to release-2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. 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.

6 participants