Skip to content

Commit

Permalink
ddl: fix vector indexes do not been dropped on TiFlash side
Browse files Browse the repository at this point in the history
Signed-off-by: Lloyd-Pottiger <[email protected]>
  • Loading branch information
Lloyd-Pottiger committed Feb 25, 2025
1 parent 62165a4 commit b156e40
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,12 @@ func onDropIndex(jobCtx *jobContext, job *model.Job) (ver int64, _ error) {
}
case model.StateDeleteReorganization:
// reorganization -> absent
isTiFlashIndex := false
indexIDs := make([]int64, 0, len(allIndexInfos))
for _, indexInfo := range allIndexInfos {
if indexInfo.IsTiFlashLocalIndex() {
isTiFlashIndex = true
}
indexInfo.State = model.StateNone
// Set column index flag.
DropIndexColumnFlag(tblInfo, indexInfo)
Expand All @@ -1628,6 +1632,13 @@ func onDropIndex(jobCtx *jobContext, job *model.Job) (ver int64, _ error) {
return ver, errors.Trace(err)
}

if isTiFlashIndex {
// Send sync schema notification to TiFlash.
if err := infosync.SyncTiFlashTableSchema(jobCtx.stepCtx, tblInfo.ID); err != nil {
logutil.DDLLogger().Warn("run drop tiflash index but syncing schema failed", zap.Error(err))
}
}

// Finish this job.
if job.IsRollingback() {
dropArgs, err := model.GetFinishedModifyIndexArgs(job)
Expand Down

0 comments on commit b156e40

Please sign in to comment.