-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
lightning: fix pd http request using old address #45680
Conversation
Hi @lichunzhu. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #45680 +/- ##
================================================
+ Coverage 73.2119% 73.2164% +0.0044%
================================================
Files 1265 1269 +4
Lines 389939 391382 +1443
================================================
+ Hits 285482 286556 +1074
- Misses 86154 86441 +287
- Partials 18303 18385 +82
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/ok-to-test |
@@ -122,7 +123,13 @@ func GetTiKVModeSwitcher(logger *zap.Logger) (local.TiKVModeSwitcher, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
return NewTiKVModeSwitcher(tls, tidbCfg.Path, logger), nil | |||
tlsOpt := tls.ToPDSecurityOption() | |||
pdCli, err := pd.NewClientWithContext(ctx, []string{tidbCfg.Path}, tlsOpt) |
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.
requires close
br/pkg/lightning/importer/import.go
Outdated
@@ -294,6 +295,10 @@ func NewImportControllerWithPauser( | |||
if err != nil { | |||
return nil, err | |||
} | |||
pdCli, err := pd.NewClientWithContext(ctx, []string{cfg.TiDB.PdAddr}, tls.ToPDSecurityOption()) |
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 closed?
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.
other places too, seems not close anywhere
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.
already addressed in f163612
PTAL again
rest lgtm. Please address existing comments |
/test check-dev2 |
@lichunzhu: The specified target(s) for
Use In response to this:
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 kubernetes/test-infra repository. |
/test check-dev2 |
@lichunzhu: The specified target(s) for
Use In response to this:
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 kubernetes/test-infra repository. |
@lichunzhu: The specified target(s) for
Use In response to this:
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 kubernetes/test-infra repository. |
/retest |
2 similar comments
/retest |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, lance6716 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:
Approvers can indicate their approval by writing |
/run-br-integration-tests |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
/cherry-pick release-7.3 |
@lichunzhu: new pull request created to branch In response to this:
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. |
/run-br-integration-test |
This PR seems incomplete to me. Why we are not using leader during scatter and split in client.go. |
Hi, do you mean tidb/br/pkg/restore/split/client.go Lines 330 to 336 in d3d30f5
We have used the region leader from given regionInfo
|
Never mind. I misinterpreted. I suppose any grpc request through pd client goes to leader. This PR is for http request only. Is that right ? |
Yes. The PD client interface https://github.com/tikv/pd/blob/d031342b4e104a3ba21812253ad84f5576aea994/client/client.go#L79 will internally choose current leader to send the request (or send to followers when network partition https://github.com/tikv/pd/blob/d031342b4e104a3ba21812253ad84f5576aea994/client/client.go#L804) But in some usage we don't use the Client interface, for example, we want to peek the leader address and use HTTP API. That's the scope of this PR and #46726 . And I have opened issue tikv/pd#7063 at PD repo to discuss about the usability of Client interface. Welcome to discuss in the new issue. This PR is closed and no other developers will notice our discussion. |
What problem does this PR solve?
Issue Number: close #43436
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.