Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cache): make acl entities group cache warmup #11414

Merged
merged 7 commits into from
Aug 18, 2023

Conversation

oowl
Copy link
Member

@oowl oowl commented Aug 16, 2023

Summary

kong acl plugin will need to get all consumer groups by customer id (because consumer group and acl plugin config some complex connection), these entities can not be warmed up by Kong, The "warm up" mechanism mainly ensures that all entities are loaded into the cache and enables more precise SQL queries (based on cache key definitions) https://github.com/Kong/kong/blob/master/kong/plugins/acl/daos.lua#L8. However, for scenarios where it is necessary to iterate through all entities under a consumer ID, caching is not possible. https://github.com/Kong/kong/blob/master/kong/plugins/acl/groups.lua#L45

So this PR tries a patch warmup mechanism to support acls entities config.

Checklist

Full changelog

Issue reference

FTI-5275

@oowl oowl force-pushed the fix/warmup_acl_plugin_groups branch 4 times, most recently from d61ff71 to de432d1 Compare August 17, 2023 07:35
@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 17, 2023
@oowl oowl requested a review from bungle August 17, 2023 07:44
kong/cache/warmup.lua Outdated Show resolved Hide resolved
@oowl oowl requested a review from ms2008 August 17, 2023 08:09
@VicYP VicYP requested a review from windmgc August 17, 2023 09:48
@oowl oowl force-pushed the fix/warmup_acl_plugin_groups branch from 1e2253b to d9b11ec Compare August 18, 2023 03:37
Copy link
Member

@windmgc windmgc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, leaving a note here that this is more likely a temporary workaround for acl entities warming up, since the code is kind of intrusive

@windmgc windmgc merged commit 72b1f62 into master Aug 18, 2023
21 checks passed
@windmgc windmgc deleted the fix/warmup_acl_plugin_groups branch August 18, 2023 05:38
windmgc pushed a commit that referenced this pull request Jan 24, 2024
kong acl plugin will need to get all consumer groups by customer id (because consumer group and acl plugin config some complex connection), these entities can not be warmed up by Kong, The "warm up" mechanism mainly ensures that all entities are loaded into the cache and enables more precise SQL queries (based on cache key definitions) https://github.com/Kong/kong/blob/master/kong/plugins/acl/daos.lua#L8. However, for scenarios where it is necessary to iterate through all entities under a consumer ID, caching is not possible. https://github.com/Kong/kong/blob/master/kong/plugins/acl/groups.lua#L45

So this PR tries a patch warmup mechanism to support acls entities config.

FTI-5275
windmgc pushed a commit that referenced this pull request Mar 7, 2024
kong acl plugin will need to get all consumer groups by customer id (because consumer group and acl plugin config some complex connection), these entities can not be warmed up by Kong, The "warm up" mechanism mainly ensures that all entities are loaded into the cache and enables more precise SQL queries (based on cache key definitions) https://github.com/Kong/kong/blob/master/kong/plugins/acl/daos.lua#L8. However, for scenarios where it is necessary to iterate through all entities under a consumer ID, caching is not possible. https://github.com/Kong/kong/blob/master/kong/plugins/acl/groups.lua#L45

So this PR tries a patch warmup mechanism to support acls entities config.

FTI-5275
windmgc pushed a commit that referenced this pull request Mar 8, 2024
kong acl plugin will need to get all consumer groups by customer id (because consumer group and acl plugin config some complex connection), these entities can not be warmed up by Kong, The "warm up" mechanism mainly ensures that all entities are loaded into the cache and enables more precise SQL queries (based on cache key definitions) https://github.com/Kong/kong/blob/master/kong/plugins/acl/daos.lua#L8. However, for scenarios where it is necessary to iterate through all entities under a consumer ID, caching is not possible. https://github.com/Kong/kong/blob/master/kong/plugins/acl/groups.lua#L45

So this PR tries a patch warmup mechanism to support acls entities config.

FTI-5275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants