Replace custom token-bucket implementation with Guava's RateLimiter#3507
Replace custom token-bucket implementation with Guava's RateLimiter#3507snazy merged 5 commits intoapache:mainfrom
RateLimiter#3507Conversation
dimas-b
left a comment
There was a problem hiding this comment.
The approach LGTM 👍 just one config concern.
| */ | ||
| long requestsPerSecond(); | ||
|
|
||
| Duration window(); |
There was a problem hiding this comment.
This could be a breaking change if older deployments defined a config value for it in application.properties (which is introspected and validated by Quarkus, IIRC). A missing "receiver" for those configs could be a runtime error (and config is under strict guarantees in our standing evolution guidelines).
Could we keep a deprecated (in code and in CHANGELOG) receiver just to improve backward compatibility?
There was a problem hiding this comment.
Re-added the window option as "deprecated for removal" and added a note to the CHANGELOG.
| | rateLimiter.tokenBucket | object | `{"requestsPerSecond":9999,"type":"default","window":"PT10S"}` | The configuration for the default rate limiter, which uses the token bucket algorithm with one bucket per realm. | | ||
| | rateLimiter.tokenBucket.requestsPerSecond | int | `9999` | The maximum number of requests per second allowed for each realm. | | ||
| | rateLimiter.tokenBucket.type | string | `"default"` | The type of the token bucket rate limiter. Only the default type is supported out of the box. | | ||
| | rateLimiter.tokenBucket.window | string | `"PT10S"` | The time window. | |
There was a problem hiding this comment.
As this is not a backward compatible change, should we update CHANGELOG.md as well?
There was a problem hiding this comment.
Added notes to the CHANGELOG
| {{- if ne .Values.rateLimiter.type "no-op" -}} | ||
| {{- $_ = set $map "polaris.rate-limiter.token-bucket.type" .Values.rateLimiter.tokenBucket.type -}} | ||
| {{- $_ = set $map "polaris.rate-limiter.token-bucket.requests-per-second" .Values.rateLimiter.tokenBucket.requestsPerSecond -}} | ||
| {{- $_ = set $map "polaris.rate-limiter.token-bucket.window" .Values.rateLimiter.tokenBucket.window -}} |
There was a problem hiding this comment.
We will also need to update https://github.com/apache/polaris/blob/main/helm/polaris/tests/configmap_test.yaml:
./helm/polaris/tests/configmap_test.yaml: - matchRegex: { path: 'data["application.properties"]', pattern: "polaris.rate-limiter.token-bucket.window=PT10S" }
./helm/polaris/tests/configmap_test.yaml: - matchRegex: { path: 'data["application.properties"]', pattern: "polaris.rate-limiter.token-bucket.window=PT5S" }
There was a problem hiding this comment.
Those are already removed (see below)
There was a problem hiding this comment.
I missed to remove the window setting right above in configmap_test tho
d133046 to
5742b60
Compare
|
Rebased due to a conflict w/ #3503 |
CHANGELOG.md
Outdated
| ### Breaking changes | ||
|
|
||
| - The (Before/After)CommitTableEvent has been removed. | ||
| - The configuration option `polaris.rate-limiter.token-bucket.window` is no longer supported and should be removed. |
There was a problem hiding this comment.
Should this be under Deprecations for now? We've not removed the "receiver" for this config, only deprecated 🤔
There was a problem hiding this comment.
I thought about that, too.
However, people should remove it now (or better: with the next release) to be safe for the release after that.
Sure, it's not really breaking, however, the parameter is no longer used - could be a interpreted as "a soft breaking change" (not sure there's a better term for that).
There was a problem hiding this comment.
I think I agree with @dimas-b, the Deprecations section seems like a better fit for this announcement.
When the property is fully removed, then we would put a note under this section (since that would be a hard breaking change).
I see that this is what we did, e.g. for the EclipseLink phase out.
Addresses the issues discussed on the dev mailing-list discussion https://lists.apache.org/thread/gkyw7m4fcbjbzhcrlrp4kcq5lr05r0m4, opting to use Guava as the easiest replacement here.
5742b60 to
9b299e1
Compare
|
Had to rebase again |
dimas-b
left a comment
There was a problem hiding this comment.
LGTM 👍 Nice improvement as discussed on dev
|
Thanks for the reviews :) |
…apache#3507) Addresses the issues discussed on the dev mailing-list discussion https://lists.apache.org/thread/gkyw7m4fcbjbzhcrlrp4kcq5lr05r0m4, opting to use Guava as the easiest replacement here.
* Replace custom token-bucket implementation with Guava's `RateLimiter` (apache#3507) Addresses the issues discussed on the dev mailing-list discussion https://lists.apache.org/thread/gkyw7m4fcbjbzhcrlrp4kcq5lr05r0m4, opting to use Guava as the easiest replacement here. * Move idempotency_records schema to v4 and add H2 support (apache#3386) * Move idempotency_records schema to v4 and add H2 support * address comments and fix test failures * fix format * add comment to resource_id * (nit): Getting started examples with mc/s5cmd to aws cli (apache#3526) * Switch mc/s3cmd to aws cli * Switch mc/s3cmd to aws cli * Add support for no KMS with s3-compatible backend (apache#3501) * chore(deps): update amazon/aws-cli docker tag to v2.33.7 (apache#3558) * Update doc for helm around rateLimiter (apache#3562) * Disable renoavte update for python version (apache#3560) * Fix the Keycloak getting-started example for 26.5+ (apache#3568) The example was failing because Keycloak 26.5 introduced stricter validation rules for session lifespan and timeout. * NoSQL: Add to runtime-service (apache#3396) * NoSQL: Add to runtime-service This change adds the NoSQL persistence to polaris-runtime-service. * chore(deps): update amazon/aws-cli docker tag to v2.33.8 (apache#3575) * Add spark sql integration test for Hudi (apache#3194) * Fix ozone getting started example (apache#3574) * Fix Ozone getting started example * Fix Ozone getting started example * Change AWS CLI image to weekly (apache#3578) * fix(deps): update dependency com.diffplug.spotless:spotless-plugin-gradle to v8.2.1 (apache#3576) * chore(deps): update registry.access.redhat.com/ubi9/openjdk-21-runtime docker tag to v1.24-2.1769108682 (apache#3588) * removed references of BEFORE/AFTER_COMMIT_VIEW (apache#3554) * nits - post-merge fixes * Last merged commit 2b0ca21 --------- Co-authored-by: Huaxin Gao <huaxin.gao11@gmail.com> Co-authored-by: Yong Zheng <yongzheng0809@gmail.com> Co-authored-by: Mend Renovate <bot@renovateapp.com> Co-authored-by: Alexandre Dutra <adutra@apache.org> Co-authored-by: Rahil C <32500120+rahil-c@users.noreply.github.com> Co-authored-by: Innocent Djiofack <djiofack007@gmail.com>
Addresses the issues discussed on the dev mailing-list discussion, opting to use Guava as the easiest replacement here.