fix CollectionNotExist on describe rg (#26541)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/26563/head
wei liu 2023-08-23 09:56:21 +08:00 committed by GitHub
parent d6473028d1
commit 0bb68cac36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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) {