Fix bug: drop empty index should be considered as legal operation

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/4973/head^2
zhenshan.cao 2021-02-26 11:19:10 +08:00 committed by yefu.chen
parent 9edbff0a6b
commit 12ea873216
1 changed files with 0 additions and 6 deletions

View File

@ -91,19 +91,13 @@ func (mt *metaTable) MarkIndexAsDeleted(indexID UniqueID) error {
mt.lock.Lock()
defer mt.lock.Unlock()
exist := false
for indexBuildID, meta := range mt.indexBuildID2Meta {
if meta.Req.IndexID == indexID {
meta.State = commonpb.IndexState_DELETED
mt.indexBuildID2Meta[indexBuildID] = meta
exist = true
}
}
if !exist {
return errors.New("index not exists")
}
return nil
}