tikv / pd

Placement driver for TiKV
Apache License 2.0
1.06k stars 724 forks source link

store_command: propagate the error code to the root command #8798

Closed JackL9u closed 2 weeks ago

JackL9u commented 3 weeks ago

What problem does this PR solve?

propagate the error code to the root command, fixing the bug mention in issue 8762

Issue Number: Ref #8762

What is changed and how does it work?

Check List

Tests

The normal case worked.

% ./pd-ctl -u http://127.0.0.1:2379 store delete addr ""
address not found: 
% echo $?                                               
1

The interactive case also works.

% ./pd-ctl -u http://127.0.0.1:2379 -i
» store delete addr ""
address not found: 
»  

Code changes

Side effects

Related changes

Release note

None.
ti-chi-bot[bot] commented 3 weeks ago

Hi @JackL9u. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 75.76%. Comparing base (2637331) to head (49b7e7d). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8798 +/- ## ========================================== - Coverage 75.80% 75.76% -0.04% ========================================== Files 461 461 Lines 72315 72316 +1 ========================================== - Hits 54817 54791 -26 - Misses 14000 14031 +31 + Partials 3498 3494 -4 ``` | [Flag](https://app.codecov.io/gh/tikv/pd/pull/8798/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/tikv/pd/pull/8798/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | `75.76% <33.33%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#carryforward-flags-in-the-pull-request-comment) to find out more.
ti-chi-bot[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, rleungx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tikv/pd/blob/master/OWNERS)~~ [nolouch,rleungx] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ti-chi-bot[bot] commented 2 weeks ago

[LGTM Timeline notifier]

Timeline:

nolouch commented 2 weeks ago

/ok-to-test

rleungx commented 2 weeks ago

/retest