branch-4.1: [feature](fe) Add meta service RPC rate limiting in FE (#65694) - #66140
Open
mymeiyi wants to merge 1 commit into
Open
branch-4.1: [feature](fe) Add meta service RPC rate limiting in FE (#65694)#66140mymeiyi wants to merge 1 commit into
mymeiyi wants to merge 1 commit into
Conversation
Add configurable FE-side rate limiting for meta service RPCs. The change introduces per-method Resilience4j rate limiters, dynamic config validation, weighted get-version limiting for batch requests, rate-limit-specific metrics, and profile/audit visibility for get-version limiter wait time.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds configurable FE-side QPS rate limiting for MetaService RPCs (cloud mode), including per-method limiters, dynamic config validation, rate-limit metrics, and exposing get-version limiter wait time in query profiles/audit.
Changes:
- Introduces a
MetaServiceRpcRateLimiter(Resilience4j-based) plus a dedicated config validator and new mutable config knobs. - Integrates rate limiting into
MetaServiceProxy, adds rate-limited + wait-latency metrics, and surfaces get-version rate-limit wait time inSummaryProfile/audit meta time. - Adds unit tests covering config validation, rate limiting behavior, and profile output.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| fe/pom.xml | Adds Resilience4j version property and dependency management entry. |
| fe/fe-core/pom.xml | Adds resilience4j-ratelimiter as an FE-core dependency. |
| fe/fe-core/src/test/java/org/apache/doris/common/profile/SummaryProfileTest.java | Adds coverage for meta version rate-limit wait time serialization/profile output. |
| fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceRpcRateLimiterTest.java | New tests for limiter behavior and config validation error paths. |
| fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java | Extends proxy tests for rate limiting, batch permit consumption, and sharing behavior. |
| fe/fe-core/src/main/java/org/apache/doris/metric/CloudMetrics.java | Adds rate-limited counters and a rate-limit-wait latency histogram. |
| fe/fe-core/src/main/java/org/apache/doris/common/profile/SummaryProfile.java | Adds tracking/reporting of get-meta-version rate-limit wait time; fixes meta-time ms getters. |
| fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceRpcRateLimiter.java | New Resilience4j-backed per-method limiter with dynamic config refresh and metrics. |
| fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceRateLimitException.java | New specialized RpcException for rate-limited calls. |
| fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceProxy.java | Wires limiter into RPC execution paths; records rate-limit metrics and get-version wait time. |
| fe/fe-common/src/main/java/org/apache/doris/common/MetaServiceRpcRateLimitConfigValidator.java | New parser/validators and mutable-config handlers for rate-limit config fields. |
| fe/fe-common/src/main/java/org/apache/doris/common/Config.java | Adds new mutable config fields controlling MetaService RPC rate limiting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <mqtt.version>1.2.5</mqtt.version> | ||
| <slf4j.version>2.0.17</slf4j.version> | ||
| <metrics-core.version>4.0.2</metrics-core.version> | ||
| <resilience4j.version>2.4.0</resilience4j.version> |
Comment on lines
+1117
to
+1119
| public long getGetMetaVersionRateLimitWaitTime() { | ||
| return getMetaVersionRateLimitWaitTime; | ||
| } |
Contributor
FE Regression Coverage ReportIncrement line coverage |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
pick #65694