mirror of https://github.com/milvus-io/milvus.git
fix CollectionNotExist on describe rg (#26541)
Signed-off-by: Wei Liu <wei.liu@zilliz.com>pull/26563/head
parent
d6473028d1
commit
0bb68cac36
|
@ -2211,11 +2211,16 @@ func (t *DescribeResourceGroupTask) Execute(ctx context.Context) error {
|
|||
getCollectionName := func(collections map[int64]int32) (map[string]int32, error) {
|
||||
ret := make(map[string]int32)
|
||||
for key, value := range collections {
|
||||
name, err := globalMetaCache.GetCollectionName(ctx, GetCurDBNameFromContextOrDefault(ctx), key)
|
||||
name, err := globalMetaCache.GetCollectionName(ctx, "", key)
|
||||
if err != nil {
|
||||
log.Warn("failed to get collection name",
|
||||
zap.Int64("collectionID", key),
|
||||
zap.Error(err))
|
||||
|
||||
// if collection has been dropped, skip it
|
||||
if common.IsCollectionNotExistError(err) {
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
ret[name] = value
|
||||
|
|
|
@ -3115,7 +3115,9 @@ func TestDescribeResourceGroupTaskFailed(t *testing.T) {
|
|||
},
|
||||
}, nil)
|
||||
err = task.Execute(ctx)
|
||||
assert.Error(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, task.result.ResourceGroup.NumOutgoingNode, 0)
|
||||
assert.Len(t, task.result.ResourceGroup.NumIncomingNode, 0)
|
||||
}
|
||||
|
||||
func TestCreateCollectionTaskWithPartitionKey(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue