diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 7dc5726ce3..34f3cfd7cd 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -1048,23 +1048,6 @@ func (c *Core) BuildIndex(ctx context.Context, segID UniqueID, numRows int64, bi return bldID, err } -// RemoveIndex will call drop index service -func (c *Core) RemoveIndex(ctx context.Context, collName string, indexName string) error { - _, indexInfos, err := c.MetaTable.GetIndexByName(collName, indexName) - if err != nil { - log.Error("GetIndexByName failed,", zap.String("collection name", collName), - zap.String("index name", indexName), zap.Error(err)) - return err - } - for _, indexInfo := range indexInfos { - if err = c.CallDropIndexService(ctx, indexInfo.IndexID); err != nil { - log.Error("CallDropIndexService failed,", zap.String("collection name", collName), zap.Error(err)) - return err - } - } - return nil -} - // ExpireMetaCache will call invalidate collection meta cache func (c *Core) ExpireMetaCache(ctx context.Context, collNames []string, collectionID UniqueID, ts typeutil.Timestamp) error { // if collectionID is specified, invalidate all the collection meta cache with the specified collectionID and return diff --git a/internal/rootcoord/task.go b/internal/rootcoord/task.go index caa1aea44c..3235bdc9bf 100644 --- a/internal/rootcoord/task.go +++ b/internal/rootcoord/task.go @@ -320,8 +320,12 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error { } // drop all indices - if err = t.core.RemoveIndex(ctx, t.Req.CollectionName, ""); err != nil { - return err + for _, fieldIndex := range collMeta.FieldIndexes { + if err := t.core.CallDropIndexService(t.core.ctx, fieldIndex.IndexID); err != nil { + log.Error("DropCollection CallDropIndexService fail", zap.String("collName", t.Req.CollectionName), + zap.Int64("indexID", fieldIndex.IndexID), zap.Error(err)) + return err + } } // Allocate a new ts to make sure the channel timetick is consistent.