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

ctl: pd-ctl cmd will work well in char device mode #4479

Merged
merged 5 commits into from
Dec 21, 2021

Conversation

bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Dec 20, 2021

What problem does this PR solve?

close #4478

What is changed and how it works?

String split mention If s does not contain sep and sep is not empty, Split returns a
slice of length 1 whose only element is s. It will add args if the arg is nil in char device mode.
So it needs to check the args is nil.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

image

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

pdctl args lens is wrong in char device mode.

Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 20, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • lhy1024

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/invalid-commit-message labels Dec 20, 2021
@bufferflies bufferflies changed the title ctl: pd-ctl cmd will work well in crontab ctl: pd-ctl cmd will work well in char device mode Dec 20, 2021
Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

Do we need to add a test for it?

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies
Copy link
Contributor Author

Do we need to add a test for it?

I think it should need.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 20, 2021
@codecov
Copy link

codecov bot commented Dec 21, 2021

Codecov Report

Merging #4479 (a1c1dd4) into master (447fbd4) will decrease coverage by 0.13%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4479      +/-   ##
==========================================
- Coverage   75.04%   74.91%   -0.14%     
==========================================
  Files         264      264              
  Lines       27931    27937       +6     
==========================================
- Hits        20961    20929      -32     
- Misses       5119     5145      +26     
- Partials     1851     1863      +12     
Flag Coverage Δ
unittests 74.91% <66.66%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tools/pd-ctl/pdctl/ctl.go 41.52% <66.66%> (+1.34%) ⬆️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
server/tso/tso.go 60.22% <0.00%> (-8.53%) ⬇️
server/region_syncer/client.go 79.68% <0.00%> (-3.91%) ⬇️
pkg/etcdutil/etcdutil.go 84.70% <0.00%> (-3.53%) ⬇️
server/tso/allocator_manager.go 64.55% <0.00%> (-3.33%) ⬇️
pkg/btree/btree.go 85.78% <0.00%> (-0.73%) ⬇️
server/grpc_service.go 51.78% <0.00%> (-0.49%) ⬇️
server/server.go 72.23% <0.00%> (+0.14%) ⬆️
server/cluster/cluster.go 82.96% <0.00%> (+0.34%) ⬆️
... and 5 more

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 447fbd4...a1c1dd4. Read the comment docs.

@bufferflies bufferflies requested a review from JmPotato December 21, 2021 04:53
Signed-off-by: bufferflies <1045931706@qq.com>
Copy link
Member

@JmPotato JmPotato left a comment

Choose a reason for hiding this comment

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

The rest LGTM.

@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 Dec 21, 2021
@nolouch
Copy link
Contributor

nolouch commented Dec 21, 2021

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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
Copy link
Member

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

Commit hash: ead512e

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 21, 2021
@ti-chi-bot
Copy link
Member

@bufferflies: 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 95293d5 into tikv:master Dec 21, 2021
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this pull request Dec 28, 2021
* pd-ctl cmd will work well in crontab && close 4478

Signed-off-by: bufferflies <1045931706@qq.com>

* add unit test && close tikv#4478

Signed-off-by: bufferflies <1045931706@qq.com>

* string nil and add return

Signed-off-by: bufferflies <1045931706@qq.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@bufferflies bufferflies deleted the bug/crontab branch February 17, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

tools: pd-ctl cmd will work well in crontab
5 participants