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 }))