未验证 提交 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 { ...@@ -2211,11 +2211,16 @@ func (t *DescribeResourceGroupTask) Execute(ctx context.Context) error {
getCollectionName := func(collections map[int64]int32) (map[string]int32, error) { getCollectionName := func(collections map[int64]int32) (map[string]int32, error) {
ret := make(map[string]int32) ret := make(map[string]int32)
for key, value := range collections { for key, value := range collections {
name, err := globalMetaCache.GetCollectionName(ctx, GetCurDBNameFromContextOrDefault(ctx), key) name, err := globalMetaCache.GetCollectionName(ctx, "", key)
if err != nil { if err != nil {
log.Warn("failed to get collection name", log.Warn("failed to get collection name",
zap.Int64("collectionID", key), zap.Int64("collectionID", key),
zap.Error(err)) zap.Error(err))
// if collection has been dropped, skip it
if common.IsCollectionNotExistError(err) {
continue
}
return nil, err return nil, err
} }
ret[name] = value ret[name] = value
......
...@@ -3115,7 +3115,9 @@ func TestDescribeResourceGroupTaskFailed(t *testing.T) { ...@@ -3115,7 +3115,9 @@ func TestDescribeResourceGroupTaskFailed(t *testing.T) {
}, },
}, nil) }, nil)
err = task.Execute(ctx) 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) { func TestCreateCollectionTaskWithPartitionKey(t *testing.T) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册