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

planner, executor: support SQL `show pump/drainer status` #9456

Merged
merged 7 commits into from Mar 4, 2019

Conversation

Projects
None yet
6 participants
@caohe
Copy link
Contributor

caohe commented Feb 25, 2019

What problem does this PR solve?

Impl #9201

  1. Support SQL show pump status and show drainer status

What is changed and how it works?

Changes executor and planbuilder.
Just like binlogctl, it gets pump and drainer status from PD.

Check List

Tests

  • Manual test(start pump and drainer, then execute show pump status and show drainer status to check)

Related changes

  • Need to update the documentation
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Feb 25, 2019

Codecov Report

Merging #9456 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9456      +/-   ##
==========================================
- Coverage   67.38%   67.35%   -0.03%     
==========================================
  Files         375      375              
  Lines       78746    78777      +31     
==========================================
- Hits        53063    53062       -1     
- Misses      20908    20940      +32     
  Partials     4775     4775
Impacted Files Coverage Δ
planner/core/planbuilder.go 48.75% <0%> (-0.24%) ⬇️
executor/show.go 43.56% <0%> (-1.55%) ⬇️
ddl/delete_range.go 75.13% <0%> (-4.24%) ⬇️
expression/schema.go 94.53% <0%> (+0.78%) ⬆️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️
executor/join.go 79.06% <0%> (+1.03%) ⬆️

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 f16081b...345c195. Read the comment docs.

@caohe caohe changed the title planner, executor: support SQL `show pump/drainer status` [WIP] planner, executor: support SQL `show pump/drainer status` Feb 25, 2019

@caohe

This comment has been minimized.

Copy link
Contributor Author

caohe commented Feb 25, 2019

@WangXiangUSTC

This comment has been minimized.

Copy link
Member

WangXiangUSTC commented Feb 26, 2019

thanks @caohe

Show resolved Hide resolved executor/show.go Outdated
Show resolved Hide resolved executor/show.go Outdated

@caohe caohe force-pushed the caohe:show_pump_and_drainer_status branch from ea618f7 to 4b29ef9 Feb 26, 2019

@caohe caohe changed the title [WIP] planner, executor: support SQL `show pump/drainer status` planner, executor: support SQL `show pump/drainer status` Feb 26, 2019

Show resolved Hide resolved executor/show.go Outdated

@tiancaiamao tiancaiamao self-requested a review Feb 27, 2019

@WangXiangUSTC

This comment has been minimized.

Copy link
Member

WangXiangUSTC commented Feb 27, 2019

rest LGTM

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

tiancaiamao commented Feb 27, 2019

LGTM
Although those kinds of feature is better to be implemented as plugin in my opinion...
PTAL @jackysp

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

@zz-jason zz-jason added status/LGT2 and removed status/LGT1 labels Feb 27, 2019

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Feb 27, 2019

/run-all-tests

@zz-jason
Copy link
Member

zz-jason left a comment

@caohe could you add some unit test?

no test

@caohe

This comment has been minimized.

Copy link
Contributor Author

caohe commented Feb 27, 2019

@zz-jason OK. @WangXiangUSTC and I have both tested it manually. But I don't know how to add unit tests to it. It seems that I should start/mock a pump/drainer in the test code? Or simply check the number of rows and columns in the result?

@jackysp

This comment has been minimized.

Copy link
Member

jackysp commented Feb 27, 2019

/run-all-tests

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Feb 27, 2019

Both "mock a pump/drainer in the test code" and "simply check the number of rows and columns in the result" are acceptable to me

@caohe caohe force-pushed the caohe:show_pump_and_drainer_status branch from 0b4dfd2 to 9631e3b Mar 1, 2019

@caohe caohe force-pushed the caohe:show_pump_and_drainer_status branch from 48c7a31 to 378e59d Mar 4, 2019

@caohe

This comment has been minimized.

Copy link
Contributor Author

caohe commented Mar 4, 2019

/run-all-tests

@WangXiangUSTC

This comment has been minimized.

Copy link
Member

WangXiangUSTC commented Mar 4, 2019

/run-all-tests

@caohe

This comment has been minimized.

Copy link
Contributor Author

caohe commented Mar 4, 2019

I have tried a few times to add unit test for this sql clause with the help of @WangXiangUSTC . But there are some difficulties in mocking pd. So I am sorry but may be not able to add unit test this time. I will add unit test when I find a better way.

@WangXiangUSTC WangXiangUSTC merged commit e7ff050 into pingcap:master Mar 4, 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

@caohe caohe deleted the caohe:show_pump_and_drainer_status branch Mar 4, 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.