Skip to content

Commit

Permalink
retry(dm): align with tidb latest error message (pingcap#4172)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored and zhaoxinyu committed Jan 20, 2022
1 parent 5eaf4f7 commit fc2eeec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions dm/pkg/retry/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
// UnsupportedDDLMsgs list the error messages of some unsupported DDL in TiDB.
UnsupportedDDLMsgs = []string{
"can't drop column with index",
"with tidb_enable_change_multi_schema is disable", // https://github.com/pingcap/tidb/pull/29526
"unsupported add column",
"unsupported modify column",
"unsupported modify charset",
Expand Down
3 changes: 2 additions & 1 deletion dm/syncer/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func isDropColumnWithIndexError(err error) bool {
return (mysqlErr.Number == errno.ErrUnsupportedDDLOperation || mysqlErr.Number == tmysql.ErrUnknown) &&
strings.Contains(mysqlErr.Message, "drop column") &&
(strings.Contains(mysqlErr.Message, "with index") ||
strings.Contains(mysqlErr.Message, "with composite index"))
strings.Contains(mysqlErr.Message, "with composite index") ||
strings.Contains(mysqlErr.Message, "with tidb_enable_change_multi_schema is disable"))
}

// handleSpecialDDLError handles special errors for DDL execution.
Expand Down
2 changes: 1 addition & 1 deletion dm/tests/drop_column_with_index/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function run() {
"\"isCanceled\": true" 1

sleep 5
check_log_not_contains "dispatch auto resume task" $WORK_DIR/worker1/log/dm-worker.log
check_log_not_contains $WORK_DIR/worker1/log/dm-worker.log "dispatch auto resume task"

run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"resume-task test" \
Expand Down
2 changes: 2 additions & 0 deletions dm/tests/others_integration_1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
drop_column_with_index
downstream_diff_index
full_mode
sequence_sharding_optimistic
sequence_sharding_removemeta
Expand Down

0 comments on commit fc2eeec

Please sign in to comment.