Skip to content

Commit

Permalink
fix checksum coprocressor panic (pingcap#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer authored and overvenus committed Nov 8, 2019
1 parent ade02e7 commit 62d24a9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/restore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,18 @@ func (rc *Client) checksumRegion(
}

resp, err := kvClient.Coprocessor(rc.ctx, req)
if err != nil || resp.GetOtherError() != "" || resp.GetLocked() != nil {
if err != nil {
return nil, errors.Trace(err)
}
if resp.GetOtherError() != "" {
log.Error("Coprocessor request error",
zap.String("OtherError", resp.GetOtherError()))
return nil, errors.Errorf("OtherError: %s", resp.GetOtherError())
}
if resp.GetLocked() != nil {
log.Error("Coprocessor request error",
zap.String("OtherError", resp.GetOtherError()),
zap.Any("Locked", resp.GetLocked()))
return nil, errors.Trace(err)
return nil, errors.Errorf("Locked: %s", resp.GetLocked().String())
}

regionErr := resp.GetRegionError()
Expand Down

0 comments on commit 62d24a9

Please sign in to comment.