fix: groups lookup performance issue with users with lots of groups (#20740)

fixes https://github.com/minio/minio/issues/20717
This commit is contained in:
Harshavardhana
2024-12-11 16:23:28 +05:30
committed by GitHub
parent d56ef8dbe1
commit 7b3eb9f7f8
2 changed files with 94 additions and 13 deletions

View File

@@ -178,13 +178,18 @@ func (sys *IAMSys) initStore(objAPI ObjectLayer, etcdClient *etcd.Client) {
}
if etcdClient == nil {
var group *singleflight.Group
var (
group *singleflight.Group
policy *singleflight.Group
)
if env.Get("_MINIO_IAM_SINGLE_FLIGHT", config.EnableOn) == config.EnableOn {
group = &singleflight.Group{}
policy = &singleflight.Group{}
}
sys.store = &IAMStoreSys{
IAMStorageAPI: newIAMObjectStore(objAPI, sys.usersSysType),
group: group,
policy: policy,
}
} else {
sys.store = &IAMStoreSys{IAMStorageAPI: newIAMEtcdStore(etcdClient, sys.usersSysType)}