-
Notifications
You must be signed in to change notification settings - Fork 720
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
client/http: implement more HTTP APIs #7371
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7371 +/- ##
=======================================
Coverage 74.28% 74.29%
=======================================
Files 451 451
Lines 48899 48967 +68
=======================================
+ Hits 36327 36380 +53
- Misses 9348 9369 +21
+ Partials 3224 3218 -6
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -154,7 +159,7 @@ func (c *client) execDuration(name string, duration time.Duration) { | |||
// it consistent with the current implementation of some clients (e.g. TiDB). | |||
func (c *client) requestWithRetry( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to customize the retry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will provide the function of custom backoffer in the future, but at present, the interface we are about to replace in TiDB uses this simple retry method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still prefer to leave it to the caller even if the retry method is simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to me though I'd like to implement it in an independent PR later.
5d35dec
to
8fbe931
Compare
func (c *client) SetPlacementRule(ctx context.Context, rule *Rule) error { | ||
ruleJSON, err := json.Marshal(rule) | ||
if err != nil { | ||
return errors.Trace(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why needs errors.Trace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is to be consistent with the original HTTP call code of TiDB, and the other is that because it is a general library, adding trace information can help us better locate where the call is wrong I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
8fbe931
to
6cef656
Compare
/merge |
@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: 6cef656
|
What problem does this PR solve?
Issue Number: ref #7300.
What is changed and how does it work?
Check List
Tests
Release note