From 3c9f26942dde992947b41561d75653028b3f4aa1 Mon Sep 17 00:00:00 2001 From: sthuang <167743503+shaoting-huang@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:29:03 +0800 Subject: [PATCH] enhance: clean up logs of empty op key (#39335) related: https://github.com/milvus-io/milvus/issues/39334 Signed-off-by: shaoting-huang --- internal/rootcoord/rbac_task.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/rootcoord/rbac_task.go b/internal/rootcoord/rbac_task.go index 50cb42f965..9bb0c38fdb 100644 --- a/internal/rootcoord/rbac_task.go +++ b/internal/rootcoord/rbac_task.go @@ -209,12 +209,14 @@ func executeOperatePrivilegeTaskSteps(ctx context.Context, core *Core, in *milvu }) }) } - if err := core.proxyClientManager.RefreshPolicyInfoCache(ctx, &proxypb.RefreshPolicyInfoCacheRequest{ - OpType: opType, - OpKey: funcutil.PolicyForPrivileges(expandGrants), - }); err != nil { - log.Ctx(ctx).Warn("fail to refresh policy info cache", zap.Any("in", in), zap.Error(err)) - return nil, err + if len(expandGrants) > 0 { + if err := core.proxyClientManager.RefreshPolicyInfoCache(ctx, &proxypb.RefreshPolicyInfoCacheRequest{ + OpType: opType, + OpKey: funcutil.PolicyForPrivileges(expandGrants), + }); err != nil { + log.Ctx(ctx).Warn("fail to refresh policy info cache", zap.Any("in", in), zap.Error(err)) + return nil, err + } } return nil, nil }))