-
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, tests: make client check if the cluster ID matches #5281
Conversation
Signed-off-by: JmPotato <ghzpotato@gmail.com>
[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
@@ Coverage Diff @@
## master #5281 +/- ##
==========================================
+ Coverage 75.63% 75.65% +0.01%
==========================================
Files 310 310
Lines 30718 30730 +12
==========================================
+ Hits 23234 23249 +15
- Misses 5483 5492 +9
+ Partials 2001 1989 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
||
// Check the cluster ID. | ||
if err == nil && members.GetHeader().GetClusterId() != c.clusterID { | ||
err = errs.ErrClientUpdateMember.FastGenByArgs("cluster id does not match") |
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.
why not use "errors.WithStack(errUnmatchedClusterID)"?
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 it's because errUnmatchedClusterID
is an error that will be returned to the upper caller, e.g, the TiDB. So it's not wrapped by the errs definition. However, in this function, it's an error that will be logged out, so it's necessary to wrap it first.
Hi, may I ask what's the expected behavior if some PD addresses are not connectable? |
I didn't add special handling logic for this because it's hard to tell if "unreachable" is a temporary state or a permanent error from the client's point of view. Given the availability, as long as there is a working PD address in it, then I think the client is ready to start. It is unacceptable to deny the entire service just because of an unreachable URL. |
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 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: ae0b365
|
Got it. Thx for the explanation! |
close tikv#5278 Let the client check if the cluster ID matches during the initialization and updating. Signed-off-by: JmPotato <ghzpotato@gmail.com>
close tikv#5278 Let the client check if the cluster ID matches during the initialization and updating. Signed-off-by: JmPotato <ghzpotato@gmail.com>
close tikv#5278 Let the client check if the cluster ID matches during the initialization and updating. Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato ghzpotato@gmail.com
What problem does this PR solve?
Issue Number: Close #5278.
What is changed and how does it work?
Check List
Tests
Release note