enhance: [2.5] clean up logs of empty op key (#39394)

cherry-pick from master: https://github.com/milvus-io/milvus/pull/39335
related: https://github.com/milvus-io/milvus/issues/39334

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
pull/39434/head
sthuang 2025-01-20 12:15:10 +08:00 committed by GitHub
parent 4464966462
commit 8c35064d01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

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