[skip e2e]Refine meta_table log (#26647)

Signed-off-by: jaime <yun.zhang@zilliz.com>
pull/26677/head
jaime 2023-08-29 14:28:40 +08:00 committed by GitHub
parent 73951c5762
commit 72ca9ac02e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -736,7 +736,8 @@ func (mt *MetaTable) RenameCollection(ctx context.Context, dbName string, oldNam
// check new collection already exists
newColl, err := mt.getCollectionByNameInternal(ctx, newDBName, newName, ts)
if newColl != nil {
return fmt.Errorf("duplicated new collection name :%s with other collection name or alias", newName)
log.Warn("get collection name fail")
return fmt.Errorf("duplicated new collection name %s:%s with other collection name or alias", newDBName, newName)
}
if err != nil && !common.IsCollectionNotExistErrorV2(err) {
log.Warn("check new collection name fail")

View File

@ -1194,10 +1194,13 @@ func TestMetaTable_RenameCollection(t *testing.T) {
t.Run("new collection name already exist-1", func(t *testing.T) {
meta := &MetaTable{
dbName2Meta: map[string]*model.Database{
util.DefaultDBName: model.NewDefaultDatabase(),
},
names: newNameDb(),
aliases: newNameDb(),
collID2Meta: map[typeutil.UniqueID]*model.Collection{
2: {
util.DefaultDBID: {
CollectionID: 1,
Name: "old",
State: pb.CollectionState_CollectionCreated,
@ -1205,8 +1208,7 @@ func TestMetaTable_RenameCollection(t *testing.T) {
},
}
meta.names.insert(util.DefaultDBName, "old", 1)
meta.names.insert(util.DefaultDBName, "new", 2)
err := meta.RenameCollection(context.TODO(), "", "old", "", "new", 1000)
err := meta.RenameCollection(context.TODO(), util.DefaultDBName, "old", util.DefaultDBName, "old", 1000)
assert.Error(t, err)
})