Skip to content

Commit

Permalink
ddl: move update version function to a proper place (#40817)
Browse files Browse the repository at this point in the history
ref #40217
  • Loading branch information
tangenta authored Jan 29, 2023
1 parent 4e9b563 commit 744de86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,9 @@ func doReorgWorkForCreateIndexMultiSchema(w *worker, d *ddlCtx, t *meta.Meta, jo
done, ver, err = doReorgWorkForCreateIndex(w, d, t, job, tbl, indexInfo)
if done {
job.MarkNonRevertible()
if err == nil {
ver, err = updateVersionAndTableInfo(d, t, job, tbl.Meta(), true)
}
}
// We need another round to wait for all the others sub-jobs to finish.
return false, ver, err
Expand Down Expand Up @@ -877,7 +880,6 @@ func doReorgWorkForCreateIndex(w *worker, d *ddlCtx, t *meta.Meta, job *model.Jo
return false, ver, err
}
indexInfo.BackfillState = model.BackfillStateInapplicable // Prevent double-write on this index.
ver, err = updateVersionAndTableInfo(d, t, job, tbl.Meta(), true)
return true, ver, err
default:
return false, 0, dbterror.ErrInvalidDDLState.GenWithStackByArgs("backfill", indexInfo.BackfillState)
Expand Down

0 comments on commit 744de86

Please sign in to comment.