-
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: introduce the HTTP client #7304
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. |
Skipping CI for Draft Pull Request. |
Codecov Report
@@ Coverage Diff @@
## master #7304 +/- ##
==========================================
- Coverage 74.55% 74.19% -0.37%
==========================================
Files 447 450 +3
Lines 48666 48908 +242
==========================================
+ Hits 36282 36286 +4
- Misses 9189 9382 +193
- Partials 3195 3240 +45
Flags with carried forward coverage won't be shown. Click here to find out more. |
dbc89cb
to
699cbfb
Compare
3abf334
to
5d2c497
Compare
5d2c497
to
acc936a
Compare
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.
rest lgtm
client/http/client.go
Outdated
} | ||
|
||
func (c *client) pdAddr() string { | ||
// TODO: support the customized PD address selection strategy. |
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 think we need it before using it in tidb.
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 implemented it to make it the same as https://github.com/pingcap/tidb/blob/6e8df186f51b90d57e29875b03afe317298bc949/pkg/store/helper/helper.go#L900-L906.
client/http/client.go
Outdated
var region RegionInfo | ||
err := c.request(ctx, "GetRegionByID", RegionByID(regionID), ®ion) |
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.
TiDB has a metric like tidb_server_pd_api_execution_duration
. before using this sdk
, It should also be considered to pass the metric into the client for compatibility.
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.
Done.
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.
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>
} | ||
|
||
// Merge merges two RegionsInfo together and returns a new one. | ||
func (ri *RegionsInfo) Merge(other *RegionsInfo) *RegionsInfo { |
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.
Where it is used?
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.
It will be used here:
pkg/executor/infoschema_reader.go:1609:37: allRegionsInfo.Merge undefined (type *"github.com/tikv/pd/client/http".RegionsInfo has no field or method Merge)
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.
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.
It's better to add a unit test for this function
216b5b7
to
f27541c
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
f27541c
to
3eff39e
Compare
724daee
to
3eff39e
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
/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: d3f308a
|
@JmPotato: 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. |
What problem does this PR solve?
Issue Number: ref #7300.
What is changed and how does it work?
Check List
Tests
Release note