Improve log print in rootcoord (#7354)

issue: #7306
Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
sunby 2021-09-13 11:56:42 +08:00 committed by GitHub
parent db7fdefcd0
commit 4c18910acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -376,7 +376,7 @@ func (mt *metaTable) GetCollectionByName(collectionName string, ts typeutil.Time
}
col, ok := mt.collID2Meta[vid]
if !ok {
return nil, fmt.Errorf("can't find collection: " + collectionName)
return nil, fmt.Errorf("can't find collection %s with id %d", collectionName, vid)
}
colCopy := proto.Clone(&col)
return colCopy.(*pb.CollectionInfo), nil

View File

@ -511,7 +511,7 @@ func TestMetaTable(t *testing.T) {
mt.collID2Meta = make(map[int64]pb.CollectionInfo)
_, err = mt.GetCollectionByName(collInfo.Schema.Name, 0)
assert.NotNil(t, err)
assert.EqualError(t, err, fmt.Sprintf("can't find collection: %s", collInfo.Schema.Name))
assert.EqualError(t, err, fmt.Sprintf("can't find collection %s with id %d", collInfo.Schema.Name, collInfo.ID))
})

View File

@ -1204,7 +1204,7 @@ func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRe
}
err := executeTask(t)
if err != nil {
log.Debug("DropCollection Failed", zap.String("name", in.CollectionName), zap.Int64("msgID", in.Base.MsgID))
log.Debug("DropCollection Failed", zap.String("name", in.CollectionName), zap.Int64("msgID", in.Base.MsgID), zap.Error(err))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "Drop collection failed: " + err.Error(),