-
Notifications
You must be signed in to change notification settings - Fork 286
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
etcd/client(ticdc): add retry operation for etcd transaction api (#4248) #4474
etcd/client(ticdc): add retry operation for etcd transaction api (#4248) #4474
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. |
/run-all-tests |
@@ -145,12 +159,31 @@ func isRetryableError(rpcName string) retry.IsRetryable { | |||
return false | |||
} | |||
if rpcName == EtcdRevoke { | |||
if etcdErr, ok := err.(rpctypes.EtcdError); ok && etcdErr.Code() == codes.NotFound { | |||
if etcdErr, ok := err.(v3rpc.EtcdError); ok && etcdErr.Code() == codes.NotFound { | |||
// it means the etcd lease is already expired or revoked | |||
return false | |||
} | |||
} | |||
|
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.
We can extract a function, such as EtcdRetryableError() bool
in the future, similar to the work in #3242
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, PTAL
/run-all-tests |
/run-dm-integration-tests |
Please add unit tests |
bf43014
to
12d4b8e
Compare
@@ -145,12 +159,31 @@ func isRetryableError(rpcName string) retry.IsRetryable { | |||
return false | |||
} | |||
if rpcName == EtcdRevoke { | |||
if etcdErr, ok := err.(rpctypes.EtcdError); ok && etcdErr.Code() == codes.NotFound { | |||
if etcdErr, ok := err.(v3rpc.EtcdError); ok && etcdErr.Code() == codes.NotFound { | |||
// it means the etcd lease is already expired or revoked | |||
return false | |||
} | |||
} | |||
|
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 can extract a function, such as EtcdRetryableError() bool
in the future, similar to the work in #3242
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #4474 +/- ##
================================================
- Coverage 55.6402% 55.5472% -0.0930%
================================================
Files 494 497 +3
Lines 61283 61760 +477
================================================
+ Hits 34098 34306 +208
- Misses 23750 24023 +273
+ Partials 3435 3431 -4 |
Has the case in #4248 been tested manually
|
In response to a cherrypick label: new pull request created: #4528. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4529. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4530. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4531. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4532. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4533. |
…gcap#4248) (pingcap#4474) close pingcap#4248 Signed-off-by: Neil Shen <overvenus@gmail.com>
…gcap#4248) (pingcap#4474) close pingcap#4248 Signed-off-by: Neil Shen <overvenus@gmail.com>
What problem does this PR solve?
Issue Number: close #4248
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
Release note