mirror of https://github.com/milvus-io/milvus.git
parent
7f61c1e8ea
commit
4b53a7fc05
|
@ -811,7 +811,10 @@ func (mt *MetaTable) DropIndex(collName, fieldName, indexName string, ts typeuti
|
|||
|
||||
collID, ok := mt.collName2ID[collName]
|
||||
if !ok {
|
||||
return 0, false, fmt.Errorf("collection name = %s not exist", collName)
|
||||
collID, ok = mt.collAlias2ID[collName]
|
||||
if !ok {
|
||||
return 0, false, fmt.Errorf("collection name = %s not exist", collName)
|
||||
}
|
||||
}
|
||||
collMeta, ok := mt.collID2Meta[collID]
|
||||
if !ok {
|
||||
|
@ -933,7 +936,10 @@ func (mt *MetaTable) GetFieldSchema(collName string, fieldName string) (schemapb
|
|||
func (mt *MetaTable) unlockGetFieldSchema(collName string, fieldName string) (schemapb.FieldSchema, error) {
|
||||
collID, ok := mt.collName2ID[collName]
|
||||
if !ok {
|
||||
return schemapb.FieldSchema{}, fmt.Errorf("collection %s not found", collName)
|
||||
collID, ok = mt.collAlias2ID[collName]
|
||||
if !ok {
|
||||
return schemapb.FieldSchema{}, fmt.Errorf("collection %s not found", collName)
|
||||
}
|
||||
}
|
||||
collMeta, ok := mt.collID2Meta[collID]
|
||||
if !ok {
|
||||
|
@ -987,7 +993,10 @@ func (mt *MetaTable) GetNotIndexedSegments(collName string, fieldName string, id
|
|||
}
|
||||
collID, ok := mt.collName2ID[collName]
|
||||
if !ok {
|
||||
return nil, schemapb.FieldSchema{}, fmt.Errorf("collection %s not found", collName)
|
||||
collID, ok = mt.collAlias2ID[collName]
|
||||
if !ok {
|
||||
return nil, schemapb.FieldSchema{}, fmt.Errorf("collection %s not found", collName)
|
||||
}
|
||||
}
|
||||
collMeta, ok := mt.collID2Meta[collID]
|
||||
if !ok {
|
||||
|
@ -1091,7 +1100,10 @@ func (mt *MetaTable) GetIndexByName(collName, indexName string) (pb.CollectionIn
|
|||
|
||||
collID, ok := mt.collName2ID[collName]
|
||||
if !ok {
|
||||
return pb.CollectionInfo{}, nil, fmt.Errorf("collection %s not found", collName)
|
||||
collID, ok = mt.collAlias2ID[collName]
|
||||
if !ok {
|
||||
return pb.CollectionInfo{}, nil, fmt.Errorf("collection %s not found", collName)
|
||||
}
|
||||
}
|
||||
collMeta, ok := mt.collID2Meta[collID]
|
||||
if !ok {
|
||||
|
|
|
@ -274,6 +274,8 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
|
|||
return fmt.Errorf("TSO alloc fail, error = %w", err)
|
||||
}
|
||||
|
||||
aliases := t.core.MetaTable.ListAliases(collMeta.ID)
|
||||
|
||||
// use lambda function here to guarantee all resources to be released
|
||||
dropCollectionFn := func() error {
|
||||
// lock for ddl operation
|
||||
|
@ -329,6 +331,20 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
|
|||
// error doesn't matter here
|
||||
t.core.proxyClientManager.InvalidateCollectionMetaCache(ctx, &req)
|
||||
|
||||
for _, alias := range aliases {
|
||||
req = proxypb.InvalidateCollMetaCacheRequest{
|
||||
Base: &commonpb.MsgBase{
|
||||
MsgType: 0, //TODO, msg type
|
||||
MsgID: 0, //TODO, msg id
|
||||
Timestamp: ts,
|
||||
SourceID: t.core.session.ServerID,
|
||||
},
|
||||
DbName: t.Req.DbName,
|
||||
CollectionName: alias,
|
||||
}
|
||||
t.core.proxyClientManager.InvalidateCollectionMetaCache(ctx, &req)
|
||||
}
|
||||
|
||||
// Update DDOperation in etcd
|
||||
return t.core.setDdMsgSendFlag(true)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue