Skip to content
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

BR download / import give up retry when meeting retryable gRPC errors #27421

Closed
YuJuncen opened this issue Aug 20, 2021 · 2 comments · Fixed by #27423
Closed

BR download / import give up retry when meeting retryable gRPC errors #27421

YuJuncen opened this issue Aug 20, 2021 · 2 comments · Fixed by #27423
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. component/br This issue is related to BR of TiDB. severity/major sig/migrate type/bug This issue is a bug.

Comments

@YuJuncen
Copy link
Contributor

YuJuncen commented Aug 20, 2021

Bug Report

1. Minimal reproduce step (Required)

Inject a fail point at here, by status.Error

failpoint.Inject("restore-storage-error", func(val failpoint.Value) {
msg := val.(string)
log.Debug("failpoint restore-storage-error injected.", zap.String("msg", msg))
e = errors.Annotate(e, msg)
})

for example:

failpoint.Inject("restore-gRPC-error", func(val failpoint.Value) {
	e = status.Error(codes.Unavailable, "the connection to TiKV has been cut by a neko, meow :3")
})

Then execute restore with GO_FAILPOINTS=github.com/pingcap/tidb/br/pkg/restore/restore-gRPC-error=1*return(true).

2. What did you expect to see? (Required)

The error should be retried, due to

switch status.Code(err) {
case codes.Unavailable, codes.Aborted:
bo.delayTime = 2 * bo.delayTime
bo.attempt--

3. What did you see instead (Required)

[2021/08/20 13:39:43.652 +08:00] [WARN] [backoff.go:76] ["unexcepted error, stop to retry"] [error="rpc error: code = Unavailable desc = the connection to TiKV has been cut by a neko, meow :3"]

4. What is your TiDB version? (Required)

Release Version: v5.0.0-master
Git Commit Hash: 6cb0c4abc210eb45c762b5d5daf561f3f77a13f9
Git Branch: master
Go Version: go1.16.4
UTC Build Time: 2021-06-02 01:33:28
Race Enabled: false
@YuJuncen YuJuncen added the type/bug This issue is a bug. label Aug 20, 2021
@YuJuncen
Copy link
Contributor Author

/component br
/sig migrate

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

@3pointer 3pointer added affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. labels Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. component/br This issue is related to BR of TiDB. severity/major sig/migrate type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants