You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Take cancel add index for example, let mock the error code in Line 45 of rollingback.go with hash e1fccc6
func convertAddIdxJob2RollbackJob(t *meta.Meta, job *model.Job, tblInfo *model.TableInfo, indexInfo *model.IndexInfo, err error) (int64, error) {
job.State = model.JobStateRollingback
// here
return 0, errors.New("mock update version and tableInfo error")
if indexInfo.Primary {
nullCols, err := getNullColInfos(tblInfo, indexInfo)
if err != nil {
return 0, errors.Trace(err)
}
for _, col := range nullCols {
// Field PreventNullInsertFlag flag reset.
col.Flag &^= mysql.PreventNullInsertFlag
}
}
For the sake of manual cancel operation, let hang on StateDeleteOnly in Line507 with index.go for a while in which we can execute admin cancel ddl job jobID in the other client.
case model.StateDeleteOnly:
time.Sleep(time.Second * 20)
// delete only -> write only
indexInfo.State = model.StateWriteOnly
2. What did you expect to see? (Required)
Since convertAddIdxJob2RollbackJob encounters an error in the internal logic, we should keep the job state as it is (canceling) and record the error count and message wait for the next ddl round. Once the error count is beyond the limitation, it job is canceled directly.
3. What did you see instead (Required)
Since convertAddIdxJob2RollbackJob encounters an error in the internal logic, the job can't be set as JobStateRollingback at every first beginning. That will leads to the rollbacking logic done with something like ERROR 1105 (HY000): json: cannot unmarshal bool into Go value of type string
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered:
AilinKid
changed the title
ddl: ddl rollingback may lead the json unmarshal error
ddl: ddl rollingback error may lead the json unmarshal error
Apr 7, 2021
AilinKid
changed the title
ddl: ddl rollingback error may lead the json unmarshal error
ddl: ddl rollingback error may lead the json unmarshal error(2)
Apr 7, 2021
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Take cancel add index for example, let mock the error code in Line 45 of
rollingback.go
with hash e1fccc6For the sake of manual cancel operation, let hang on
StateDeleteOnly
in Line507 withindex.go
for a while in which we can executeadmin cancel ddl job jobID
in the other client.2. What did you expect to see? (Required)
Since
convertAddIdxJob2RollbackJob
encounters an error in the internal logic, we should keep the job state as it is (canceling) and record the error count and message wait for the next ddl round. Once the error count is beyond the limitation, it job is canceled directly.3. What did you see instead (Required)
Since
convertAddIdxJob2RollbackJob
encounters an error in the internal logic, the job can't be set asJobStateRollingback
at every first beginning. That will leads to the rollbacking logic done with something likeERROR 1105 (HY000): json: cannot unmarshal bool into Go value of type string
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: