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

*: add service subcommand #5971

Merged
merged 6 commits into from
Feb 15, 2023
Merged

*: add service subcommand #5971

merged 6 commits into from
Feb 15, 2023

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Feb 13, 2023

What problem does this PR solve?

Issue Number: Ref #5836.

What is changed and how does it work?

This PR has a similar functionality to #5964 but uses the independent config for starting the TSO server. Besides, we can use the same function to init log for all binaries now.
Update:
Replace the original implementation with the cobra.

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 13, 2023

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

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 13, 2023
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2023
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 13, 2023
@rleungx rleungx marked this pull request as ready for review February 13, 2023 06:44
@ti-chi-bot ti-chi-bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue labels Feb 13, 2023
@codecov
Copy link

codecov bot commented Feb 13, 2023

Codecov Report

Base: 75.07% // Head: 75.04% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (a4f317c) compared to base (29520a3).
Patch coverage: 65.43% of modified lines in pull request are covered.

❗ Current head a4f317c differs from pull request most recent head 7bbde8c. Consider uploading reports for the commit 7bbde8c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5971      +/-   ##
==========================================
- Coverage   75.07%   75.04%   -0.03%     
==========================================
  Files         362      362              
  Lines       36283    36300      +17     
==========================================
+ Hits        27238    27243       +5     
- Misses       6657     6673      +16     
+ Partials     2388     2384       -4     
Flag Coverage Δ
unittests 75.04% <65.43%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
pkg/tso/config.go 0.00% <0.00%> (ø)
server/config/config.go 75.74% <74.07%> (+0.33%) ⬆️
pkg/utils/logutil/log.go 81.57% <75.00%> (-1.76%) ⬇️
tests/config.go 93.65% <91.30%> (-1.48%) ⬇️
server/server.go 74.74% <100.00%> (+1.42%) ⬆️
server/testutil.go 90.62% <100.00%> (ø)
tests/cluster.go 79.27% <100.00%> (ø)
server/api/diagnostic.go 76.92% <0.00%> (-23.08%) ⬇️
pkg/mcs/discovery/register.go 53.48% <0.00%> (-18.61%) ⬇️
server/region_syncer/server.go 82.96% <0.00%> (-4.40%) ⬇️
... and 24 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 13, 2023
@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 Feb 13, 2023
lhy1024 added a commit to lhy1024/pd that referenced this pull request Feb 13, 2023
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024
Copy link
Contributor

lhy1024 commented Feb 13, 2023

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: e849dd5

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 13, 2023
@rleungx
Copy link
Member Author

rleungx commented Feb 13, 2023

/hold

@rleungx
Copy link
Member Author

rleungx commented Feb 15, 2023

/hold cancel

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2023
@rleungx rleungx removed the status/LGT2 Indicates that a PR has LGTM 2. label Feb 15, 2023
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Feb 15, 2023
@rleungx
Copy link
Member Author

rleungx commented Feb 15, 2023

Since the PR has been rewritten, need two more LGTM before merging.

cmd := &cobra.Command{
Use: "tso [args]",
Short: "run a tso service",
Run: tso.CreateServerWrapper,
Copy link
Contributor

Choose a reason for hiding this comment

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

so this is why we removed the return data types and have to duplicate server run() and exit code. LGTM

Copy link
Contributor

@binshi-bing binshi-bing left a comment

Choose a reason for hiding this comment

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

Looks like with Cobra, we have to duplicate server.run and exit code. LGTM

@ti-chi-bot
Copy link
Member

@binshi-bing: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

Looks like with Cobra, we have to duplicate server.run and exit code. LGTM

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.

@lhy1024
Copy link
Contributor

lhy1024 commented Feb 15, 2023

Looks like with Cobra, we have to duplicate server.run and exit code. LGTM

I think we can will move some functions to util.go after ensuring todo in tso server

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx
Copy link
Member Author

rleungx commented Feb 15, 2023

@JmPotato @nolouch Please take a look when you are available.

@nolouch
Copy link
Contributor

nolouch commented Feb 15, 2023

/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: d131cf5

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

@rleungx: Your PR was out of date, I have automatically updated it for you.

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 f1e3bf5 into tikv:master Feb 15, 2023
@rleungx rleungx deleted the cmd branch February 16, 2023 02:26
ti-chi-bot pushed a commit that referenced this pull request Feb 16, 2023
ref #5836, ref #5971

Signed-off-by: Ryan Leung <rleungx@gmail.com>
nolouch pushed a commit to nolouch/pd that referenced this pull request Feb 24, 2023
ref tikv#5836, ref tikv#5964

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: lhy1024 <admin@liudos.us>
nolouch pushed a commit to nolouch/pd that referenced this pull request Feb 24, 2023
ref tikv#5836, ref tikv#5971

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. 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.

6 participants