Skip to content

Commit

Permalink
remove UnresumableErr
Browse files Browse the repository at this point in the history
  • Loading branch information
GMHDBJD committed Jun 15, 2020
1 parent 0669bca commit d41e7c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
14 changes: 3 additions & 11 deletions dm/worker/task_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,25 +259,21 @@ func (tsc *realTaskStatusChecker) run() {
// isResumableError checks the error message and returns whether we need to
// resume the task and retry
func isResumableError(err *pb.ProcessError) bool {
if err.Error == nil {
return true
}

switch err.Type {
case pb.ErrorType_ExecSQL:
// not elegant code, because TiDB doesn't expose some error
for _, msg := range retry.UnsupportedDDLMsgs {
if strings.Contains(strings.ToLower(err.Error.RawCause), strings.ToLower(msg)) {
if err.Error != nil && strings.Contains(strings.ToLower(err.Error.RawCause), strings.ToLower(msg)) {
return false
}
}
for _, msg := range retry.UnsupportedDMLMsgs {
if strings.Contains(strings.ToLower(err.Error.RawCause), strings.ToLower(msg)) {
if err.Error != nil && strings.Contains(strings.ToLower(err.Error.RawCause), strings.ToLower(msg)) {
return false
}
}
case pb.ErrorType_UnknownError:
if err.Error.ErrCode == int32(terror.ErrParserParseRelayLog.Code()) {
if err.Error != nil && err.Error.ErrCode == int32(terror.ErrParserParseRelayLog.Code()) {
for _, msg := range retry.ParseRelayLogErrMsgs {
if strings.Contains(strings.ToLower(err.Error.Message), strings.ToLower(msg)) {
return false
Expand All @@ -286,10 +282,6 @@ func isResumableError(err *pb.ProcessError) bool {
}
}

if _, ok := retry.UnresumableErrCodes[err.Error.ErrCode]; ok {
return false
}

return true
}

Expand Down
7 changes: 0 additions & 7 deletions pkg/retry/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ package retry

import (
"database/sql/driver"

"github.com/pingcap/dm/pkg/terror"
"github.com/pingcap/errors"
)

Expand All @@ -43,11 +41,6 @@ var (
"binlog checksum mismatch, data may be corrupted",
"get event err EOF",
}

// UnresumableErrCodes is a set of unresumeable err codes.
UnresumableErrCodes = map[int32]struct{}{
int32(terror.ErrSyncUnitDDLWrongSequence.Code()): {},
}
)

// IsConnectionError tells whether this error should reconnect to Database
Expand Down

0 comments on commit d41e7c0

Please sign in to comment.