Refine log level (#20896)

Signed-off-by: longjiquan <jiquan.long@zilliz.com>

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
pull/20837/head
Jiquan Long 2022-11-30 14:11:15 +08:00 committed by GitHub
parent 83244afcf3
commit 5a6a92d603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 29 deletions

View File

@ -814,7 +814,7 @@ func (kc *Catalog) AlterGrant(ctx context.Context, tenant string, entity *milvus
v, err = kc.Txn.Load(k)
if err != nil {
log.Error("fail to load grant privilege entity", zap.String("key", k), zap.Any("type", operateType), zap.Error(err))
log.Warn("fail to load grant privilege entity", zap.String("key", k), zap.Any("type", operateType), zap.Error(err))
if funcutil.IsRevoke(operateType) {
if common.IsKeyNotExistError(err) {
return common.NewIgnorableError(fmt.Errorf("the grant[%s] isn't existed", k))
@ -837,7 +837,7 @@ func (kc *Catalog) AlterGrant(ctx context.Context, tenant string, entity *milvus
k = funcutil.HandleTenantForEtcdKey(GranteeIDPrefix, tenant, fmt.Sprintf("%s/%s", idStr, privilegeName))
_, err = kc.Txn.Load(k)
if err != nil {
log.Error("fail to load the grantee id", zap.String("key", k), zap.Error(err))
log.Warn("fail to load the grantee id", zap.String("key", k), zap.Error(err))
if !common.IsKeyNotExistError(err) {
return err
}

View File

@ -1495,7 +1495,7 @@ func (node *Proxy) GetLoadingProgress(ctx context.Context, request *milvuspb.Get
zap.Any("request", request))
getErrResponse := func(err error) *milvuspb.GetLoadingProgressResponse {
log.Error("fail to get loading progress",
log.Warn("fail to get loading progress",
zap.Error(err),
zap.String("collection_name", request.CollectionName),
zap.Strings("partition_name", request.PartitionNames))
@ -3212,7 +3212,7 @@ func (node *Proxy) LoadBalance(ctx context.Context, req *milvuspb.LoadBalanceReq
collectionID, err := globalMetaCache.GetCollectionID(ctx, req.GetCollectionName())
if err != nil {
log.Error("failed to get collection id",
log.Warn("failed to get collection id",
zap.String("collection name", req.GetCollectionName()),
zap.Error(err))
status.Reason = err.Error()
@ -3231,14 +3231,14 @@ func (node *Proxy) LoadBalance(ctx context.Context, req *milvuspb.LoadBalanceReq
CollectionID: collectionID,
})
if err != nil {
log.Error("Failed to LoadBalance from Query Coordinator",
log.Warn("Failed to LoadBalance from Query Coordinator",
zap.Any("req", req),
zap.Error(err))
status.Reason = err.Error()
return status, nil
}
if infoResp.ErrorCode != commonpb.ErrorCode_Success {
log.Error("Failed to LoadBalance from Query Coordinator",
log.Warn("Failed to LoadBalance from Query Coordinator",
zap.String("errMsg", infoResp.Reason))
status.Reason = infoResp.Reason
return status, nil

View File

@ -450,7 +450,7 @@ func (sched *taskScheduler) processTask(t task, q taskQueue) {
}()
if err != nil {
trace.LogError(span, err)
log.Error("Failed to pre-execute task: " + err.Error())
log.Warn("Failed to pre-execute task: " + err.Error())
return
}
@ -458,7 +458,7 @@ func (sched *taskScheduler) processTask(t task, q taskQueue) {
err = t.Execute(ctx)
if err != nil {
trace.LogError(span, err)
log.Error("Failed to execute task: ", zap.Error(err))
log.Warn("Failed to execute task: ", zap.Error(err))
return
}
@ -467,7 +467,7 @@ func (sched *taskScheduler) processTask(t task, q taskQueue) {
if err != nil {
trace.LogError(span, err)
log.Error("Failed to post-execute task: ", zap.Error(err))
log.Warn("Failed to post-execute task: ", zap.Error(err))
return
}
}

View File

@ -99,13 +99,13 @@ func (broker *CoordinatorBroker) GetPartitions(ctx context.Context, collectionID
}
resp, err := broker.rootCoord.ShowPartitions(ctx, req)
if err != nil {
log.Error("showPartition failed", zap.Int64("collectionID", collectionID), zap.Error(err))
log.Warn("showPartition failed", zap.Int64("collectionID", collectionID), zap.Error(err))
return nil, err
}
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
err = errors.New(resp.Status.Reason)
log.Error("showPartition failed", zap.Int64("collectionID", collectionID), zap.Error(err))
log.Warn("showPartition failed", zap.Int64("collectionID", collectionID), zap.Error(err))
return nil, err
}

View File

@ -889,7 +889,7 @@ func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequ
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to has collection", zap.Error(err))
log.Warn("failed to enqueue request to has collection", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("HasCollection", metrics.FailLabel).Inc()
return &milvuspb.BoolResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "HasCollection failed: "+err.Error()),
@ -898,7 +898,7 @@ func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequ
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to has collection", zap.Error(err))
log.Warn("failed to has collection", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("HasCollection", metrics.FailLabel).Inc()
return &milvuspb.BoolResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "HasCollection failed: "+err.Error()),
@ -977,7 +977,7 @@ func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeColl
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to describe collection", zap.Error(err))
log.Warn("failed to enqueue request to describe collection", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("DescribeCollection", metrics.FailLabel).Inc()
return &milvuspb.DescribeCollectionResponse{
// TODO: use commonpb.ErrorCode_CollectionNotExists. SDK use commonpb.ErrorCode_UnexpectedError now.
@ -986,7 +986,7 @@ func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeColl
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to describe collection", zap.Error(err))
log.Warn("failed to describe collection", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("DescribeCollection", metrics.FailLabel).Inc()
return &milvuspb.DescribeCollectionResponse{
// TODO: use commonpb.ErrorCode_CollectionNotExists. SDK use commonpb.ErrorCode_UnexpectedError now.
@ -1026,7 +1026,7 @@ func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollections
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to show collections", zap.Error(err))
log.Warn("failed to enqueue request to show collections", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("ShowCollections", metrics.FailLabel).Inc()
return &milvuspb.ShowCollectionsResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "ShowCollections failed: "+err.Error()),
@ -1034,7 +1034,7 @@ func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollections
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to show collections", zap.Error(err))
log.Warn("failed to show collections", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("ShowCollections", metrics.FailLabel).Inc()
return &milvuspb.ShowCollectionsResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "ShowCollections failed: "+err.Error()),
@ -1071,7 +1071,7 @@ func (c *Core) AlterCollection(ctx context.Context, in *milvuspb.AlterCollection
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to alter collection",
log.Warn("failed to enqueue request to alter collection",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("name", in.GetCollectionName()))
@ -1081,7 +1081,7 @@ func (c *Core) AlterCollection(ctx context.Context, in *milvuspb.AlterCollection
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to alter collection",
log.Warn("failed to alter collection",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("name", in.GetCollectionName()),
@ -1242,7 +1242,7 @@ func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionReques
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to has partition", zap.Error(err))
log.Warn("failed to enqueue request to has partition", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("HasPartition", metrics.FailLabel).Inc()
return &milvuspb.BoolResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "HasPartition failed: "+err.Error()),
@ -1251,7 +1251,7 @@ func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionReques
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to has partition", zap.Error(err))
log.Warn("failed to has partition", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("HasPartition", metrics.FailLabel).Inc()
return &milvuspb.BoolResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "HasPartition failed: "+err.Error()),
@ -1289,7 +1289,7 @@ func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionsRe
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to show partitions", zap.Error(err))
log.Warn("failed to enqueue request to show partitions", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("ShowPartitions", metrics.FailLabel).Inc()
return &milvuspb.ShowPartitionsResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "ShowPartitions failed: "+err.Error()),
@ -1297,7 +1297,7 @@ func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionsRe
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to show partitions", zap.Error(err))
log.Warn("failed to show partitions", zap.Error(err))
metrics.RootCoordDDLReqCounter.WithLabelValues("ShowPartitions", metrics.FailLabel).Inc()
return &milvuspb.ShowPartitionsResponse{
Status: failStatus(commonpb.ErrorCode_UnexpectedError, "ShowPartitions failed: "+err.Error()),
@ -1502,7 +1502,7 @@ func (c *Core) CreateAlias(ctx context.Context, in *milvuspb.CreateAliasRequest)
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to create alias",
log.Warn("failed to enqueue request to create alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()),
@ -1513,7 +1513,7 @@ func (c *Core) CreateAlias(ctx context.Context, in *milvuspb.CreateAliasRequest)
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to create alias",
log.Warn("failed to create alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()),
@ -1558,7 +1558,7 @@ func (c *Core) DropAlias(ctx context.Context, in *milvuspb.DropAliasRequest) (*c
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to drop alias",
log.Warn("failed to enqueue request to drop alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()))
@ -1568,7 +1568,7 @@ func (c *Core) DropAlias(ctx context.Context, in *milvuspb.DropAliasRequest) (*c
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to drop alias",
log.Warn("failed to drop alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()),
@ -1612,7 +1612,7 @@ func (c *Core) AlterAlias(ctx context.Context, in *milvuspb.AlterAliasRequest) (
}
if err := c.scheduler.AddTask(t); err != nil {
log.Error("failed to enqueue request to alter alias",
log.Warn("failed to enqueue request to alter alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()),
@ -1623,7 +1623,7 @@ func (c *Core) AlterAlias(ctx context.Context, in *milvuspb.AlterAliasRequest) (
}
if err := t.WaitToFinish(); err != nil {
log.Error("failed to alter alias",
log.Warn("failed to alter alias",
zap.String("role", typeutil.RootCoordRole),
zap.Error(err),
zap.String("alias", in.GetAlias()),