Skip to content

branch-4.1: [feature](fe) Add meta service RPC rate limiting in FE (#65694) - #66140

Open
mymeiyi wants to merge 1 commit into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-65694
Open

branch-4.1: [feature](fe) Add meta service RPC rate limiting in FE (#65694)#66140
mymeiyi wants to merge 1 commit into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-65694

Conversation

@mymeiyi

@mymeiyi mymeiyi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

pick #65694

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.
@mymeiyi
mymeiyi requested a review from yiguolei as a code owner July 28, 2026 02:10
Copilot AI review requested due to automatic review settings July 28, 2026 02:10
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@mymeiyi

mymeiyi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 in SummaryProfile/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.

Comment thread fe/pom.xml
<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;
}
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 22.84% (45/197) 🎉
Increment coverage report
Complete coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants