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

variable: change "ddl_slow_threshold" #9043

Merged
merged 5 commits into from Mar 7, 2019

Conversation

Projects
None yet
5 participants
@xiekeyi98
Copy link
Member

xiekeyi98 commented Jan 14, 2019

Except changing "ddl_slow"threshold" by POST , we also can use SQL to
change it now.

What problem does this PR solve?

HTTP POST is hard to use.
According to this PR , we can use SQL to change "ddl_slow_threshold".

What is changed and how it works?

Change the variable package so that we can use SQL to change.

mysql> show variables like "%ddl_slow_%";
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| ddl_slow_threshold | 300   |
+--------------------+-------+
1 row in set (0.01 sec)

mysql> set session ddl_slow_threshold=12345;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like "%ddl_slow_%";
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| ddl_slow_threshold | 12345 |
+--------------------+-------+
1 row in set (0.01 sec)

mysql> set @@session.ddl_slow_threshold=54321;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@session.ddl_slow_threshold;
+------------------------------+
| @@session.ddl_slow_threshold |
+------------------------------+
| 54321                        |
+------------------------------+
1 row in set (0.01 sec)

mysql> 
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 14, 2019

Codecov Report

Merging #9043 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9043      +/-   ##
==========================================
- Coverage   67.31%   67.31%   -0.01%     
==========================================
  Files         376      376              
  Lines       78963    78967       +4     
==========================================
+ Hits        53156    53157       +1     
- Misses      21051    21056       +5     
+ Partials     4756     4754       -2
Impacted Files Coverage Δ
sessionctx/variable/sysvar.go 100% <ø> (ø) ⬆️
sessionctx/variable/varsutil.go 25.14% <0%> (-0.16%) ⬇️
sessionctx/variable/session.go 30.06% <0%> (-0.2%) ⬇️
store/tikv/scan.go 73.94% <0%> (-3.37%) ⬇️
executor/executor.go 68.44% <0%> (-0.14%) ⬇️
executor/aggregate.go 79.11% <0%> (+0.21%) ⬆️
executor/show.go 43.97% <0%> (+0.41%) ⬆️
executor/distsql.go 74.25% <0%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76e1e58...73c94bf. Read the comment docs.

@winkyao
Copy link
Member

winkyao left a comment

Please add some test cases. As a reference, you can take a look at https://github.com/pingcap/tidb/blob/master/executor/set_test.go#L255, not only check the @@session.ddl_slow_threshold but also the variable. DDLSlowOprThreshold

@xiekeyi98 xiekeyi98 force-pushed the xiekeyi98:tidb-2732 branch from 75451a2 to 5a411d6 Jan 15, 2019

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 15, 2019

PTAL @winkyao

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 15, 2019

/run-all-tests

@xiekeyi98 xiekeyi98 force-pushed the xiekeyi98:tidb-2732 branch from 155eb37 to 5a411d6 Jan 17, 2019

Show resolved Hide resolved executor/set_test.go Outdated
Show resolved Hide resolved executor/set_test.go Outdated
@winkyao
Copy link
Member

winkyao left a comment

reset LGTM

xiekeyi98 added some commits Jan 14, 2019

variable: change "ddl_slow_threshold"
Except changing "ddl_slow"threshold" by POST , we also can use SQL to
change it now.

@xiekeyi98 xiekeyi98 force-pushed the xiekeyi98:tidb-2732 branch from 1e42f23 to 36ccb3e Jan 17, 2019

Show resolved Hide resolved executor/set_test.go Outdated

@xiekeyi98 xiekeyi98 force-pushed the xiekeyi98:tidb-2732 branch from b4860ba to d82d613 Jan 18, 2019

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 18, 2019

/run-all-tests

1 similar comment
@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 21, 2019

/run-all-tests

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 21, 2019

/run-unit-test

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 21, 2019

/run-integration-common-test
/run-sqllogic-test-2

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 21, 2019

/run-unit-test

@winkyao
Copy link
Member

winkyao left a comment

LGTM

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Jan 21, 2019

@zimulala PATLo(╥﹏╥)o;

@winkyao

This comment has been minimized.

Copy link
Member

winkyao commented Jan 21, 2019

/run-unit-test

@zimulala
Copy link
Member

zimulala left a comment

I think we can handle this variable as a global variable. In a cluster, the owner can't get the corresponding session variable when handling the DDL job now.

@xiekeyi98 xiekeyi98 added status/WIP and removed status/WIP labels Jan 21, 2019

@xiekeyi98 xiekeyi98 force-pushed the xiekeyi98:tidb-2732 branch from dc18dfa to d82d613 Jan 28, 2019

@crazycs520
Copy link
Contributor

crazycs520 left a comment

LGTM

@xiekeyi98

This comment has been minimized.

Copy link
Member Author

xiekeyi98 commented Mar 7, 2019

/run-all-tests

@xiekeyi98 xiekeyi98 merged commit d35d3a5 into pingcap:master Mar 7, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@xiekeyi98 xiekeyi98 deleted the xiekeyi98:tidb-2732 branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.