-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[cherry release/3.4.x] cherry-picking important fixes to 34x #12403
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
plugins/rate-limiting
core/db
core/logs
plugins/acl
schema-change-noteworthy
core/wasm
Everything relevant to [proxy-]wasm
labels
Jan 24, 2024
fffonion
approved these changes
Jan 24, 2024
samugi
approved these changes
Jan 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed:
- fix(rate-limiting): counters accuracy with redis policy & sync_rate
- fix(plugin): RL instances sync to the same DB at same rate
lgtm
tzssangglass
approved these changes
Jan 25, 2024
Reviewed:
LGTM |
chobits
approved these changes
Jan 25, 2024
@windmgc it seems you already have enough approvals but the branch has conflicts, can you review them, please? |
- fix: lazily initialize structures to avoid c-boundary errors on require [87](Kong/lua-resty-aws#87) - fix: remove more module-level uses of config.global [83](Kong/lua-resty-aws#83) - fix: don't invoke region detection code on the module toplevel and advise against trying to. [81](Kong/lua-resty-aws#81) Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
…n log serialize (#11566) In the function of `kong.log.serialize`, the lifecycle of three table `ctx.route`, `ctx.service` and `ctx.authenticated_consumer` is across request. Modifying the sub-items in the current request of the table will affect the next request, resulting in unexpected behavior in Kong. Fix FTI-5357 --------- Signed-off-by: sabertobihwy <sabertobihwy@gmail.com>
…11859) * fix(rate-limiting): redis async updates When the periodic sync to redis feature is turned on, using the `sync_rate` configuration option, keys are incremented by steps of 2 instead of 1 for requests that arrive after the `sync_rate` interval has expired. This happens because after each sync, the key is loaded again from redis and also incremented atomically (see: #10559) however the next call to `increment` also adds 1 to its value, so the key is incremented by 2 every time it's loaded from redis. This fix sets a negative delta for the key when `conf.sync_rate ~= SYNC_RATE_REALTIME` and the key was loaded from redis in order to invalidate the next call to `increment`. Includes a small code refactor
All rate-limiting plugin instance syncs with the same plugin config, that is the very first config got hit by a request, and they all sync with the same rate. Even a config update won't change the DB to be synced. The timer will sync not just the same instance's counters but all counters in the same DB. This is a compromise given the emergency and we prefer simplicity over correctness for this behavior. Full changelog - The counter table is split with DB; - Timers are created when a request hits; - The sync_rate is guaranteed with limited running timers and timer delay - Cover the case in the integration test by "with_sync_rate" Fix KAG-2904 Co-authored-by: samugi <samuele@konghq.com>
### Summary The PR #11480 introduced a bug that calls `store_connection` without passing `self`. This fixes that. Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
…11464) * fix(declarative): fix TTL not working in DB-less and Hybrid mode * Previously, in DB-less and Hybrid mode, the ttl/updated_at fields were not copied from the original entities to the flattened entities. As a result, the entities were loaded without the TTL field. * Additionally, for loading the TTL field, the "off" DB strategy (lmdb) did not properly filter expired items, nor returned right TTL value for DAO. FTI-4512 * fix coding style * fix coding style: improved function name * added test case: hybrid mode for key-auth * fix test case warnings * fixed test case consumer domain * export ttl as absolute value * delete unused defination * move ttl-fixing logic into row_to_entity() * still use pg to caculate relative value * clean code * add changelog entry * fixed test cases * fixed test cases warning * fixed test failure * fix test case issue: ttl expiration * fix test case: unsed local variable * add an entry in CHANGELOG.md * fix changelog scope * remove release-related information in CHANGELOG.md * fix test case: sleep before attempting unnecessary requests * sleep before attempting unnecessary requests * decrease the ttl to expedite the case's execution * fix CHANGELOG typo * fix the tense problem of changelog entry * add export options for "page_*_for_export" sql statement * fix warning: setting non-standard global variable * fix error reporting: options is nil * fix an issue where the off strategy returned the expired entity * run ttl processing before schema:process_auto_fields()
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
force-pushed
the
cherry-pick-important-fixes-34x
branch
from
March 7, 2024 09:45
ed37f2c
to
edf3ed6
Compare
@locao Done! It can be REBASE merged when all CI passed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core/db
core/logs
core/wasm
Everything relevant to [proxy-]wasm
plugins/acl
plugins/rate-limiting
schema-change-noteworthy
size/XXL
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR cherry-picks some of the important fixes to
release/3.4.x
so that we can get alignment betweenrelease/3.4.x
andnext/3.4.x.x
Contains the following PRs:
#11613
#11566
#11859
#12003
#11926
#11464
#11414
#11437
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.md