未验证 提交 0bb68cac 编写于 作者: W wei liu 提交者: GitHub

fix CollectionNotExist on describe rg (#26541)

Signed-off-by: NWei Liu <wei.liu@zilliz.com>
上级 d6473028
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册