mirror of https://github.com/milvus-io/milvus.git
Fix bug: drop empty index should be considered as legal operation
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/4973/head^2
parent
9edbff0a6b
commit
12ea873216
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue