Skip to content

[fix](fe) Retry meta service too busy responses#65378

Open
mymeiyi wants to merge 1 commit into
apache:masterfrom
mymeiyi:fe-retry-for-ms-too-busy
Open

[fix](fe) Retry meta service too busy responses#65378
mymeiyi wants to merge 1 commit into
apache:masterfrom
mymeiyi:fe-retry-for-ms-too-busy

Conversation

@mymeiyi

@mymeiyi mymeiyi commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

When a meta service RPC returned successfully but carried MS_TOO_BUSY in the response status, FE returned that response immediately and let callers handle a transient overload as a normal business result.
This change passes a typed status extractor into executeRequest, retries MS_TOO_BUSY responses with the existing retry counter and backoff, and throws RpcException if all attempts still return MS_TOO_BUSY.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: MetaServiceProxy only retried transport failures. When a meta service RPC returned successfully but carried MS_TOO_BUSY in the response status, FE returned that response immediately and let callers handle a transient overload as a normal business result. This change passes a typed status extractor into executeRequest, retries MS_TOO_BUSY responses with the existing retry counter and backoff, and throws RpcException if all attempts still return MS_TOO_BUSY. The retry path does not mark the client as failed, so it does not trigger connection shutdown.

### Release note

None

### Check List (For Author)

- Test: Not run (user requested not to compile or run tests)
- Behavior changed: Yes (MS_TOO_BUSY meta service responses are retried by FE MetaServiceProxy and fail after retries are exhausted)
- Does this need documentation: No
@mymeiyi mymeiyi requested a review from gavinchou as a code owner July 8, 2026 10:16
Copilot AI review requested due to automatic review settings July 8, 2026 10:16
@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 8, 2026

Copy link
Copy Markdown
Contributor Author

/review

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 improves FE’s cloud MetaService RPC resilience by treating MS_TOO_BUSY as a transient overload signal (even when the RPC itself succeeds), retrying with the existing retry/backoff loop, and surfacing an RpcException only after retries are exhausted.

Changes:

  • Extend MetaServiceClientWrapper.executeRequest / executeWithMetrics to accept a typed statusExtractor and retry responses whose status code is MS_TOO_BUSY.
  • Update all MetaServiceProxy RPC wrappers to pass the correct getStatus extractor.
  • Add FE unit tests validating: no shutdown on MS_TOO_BUSY, retry-to-success, and failure after retries.

Review Checkpoint Conclusions (from skill checklist)

  • Goal & completeness: The change matches the PR description (retry MS_TOO_BUSY responses) and adds targeted unit tests demonstrating the new behavior.
  • Scope: Focused to MetaServiceProxy retry behavior and tests; no unrelated refactors observed.
  • Concurrency/lifecycle: No new concurrency primitives introduced; retry loop behavior remains synchronous and uses existing Thread.sleep backoff.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceProxy.java Adds status-based retry for MS_TOO_BUSY by passing a response-status extractor through the existing retry/metrics wrapper.
fe/fe-core/src/test/java/org/apache/doris/cloud/rpc/MetaServiceProxyTest.java Updates existing tests for new API signature and adds coverage for MS_TOO_BUSY retry/failure behavior.
Comments suppressed due to low confidence (1)

fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceProxy.java:249

  • Log message contains a typo: "meta servive" → "meta service".
                    requestFailed = true;
                    LOG.warn("failed to request meta servive trycnt {}", tried, e);
                    if (tried >= maxRetries) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot 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.

Review complete. I found one correctness gap: the new MS_TOO_BUSY response retry is wired through the shared synchronous wrapper, but MetaServiceProxy.getInstance() still bypasses that wrapper and can return a status-bearing too-busy response directly. I left one inline comment.

Critical checkpoint conclusions:

  • Goal/test: wrapper-based synchronous RPCs now retry MS_TOO_BUSY and have focused unit coverage, but getInstance is a parallel status-bearing RPC path without the new retry behavior or a test.
  • Scope: the change is mostly focused and does not add config, storage format, or protocol fields.
  • Concurrency/lifecycle: no new shared mutable state or lock ordering change found; the retry path intentionally avoids marking MS_TOO_BUSY as a client failure.
  • Compatibility: mixed FE/meta-service compatibility is not materially changed because MS_TOO_BUSY already exists in the proto.
  • Parallel paths: getInstance is the uncovered parallel path and is the blocking issue.
  • Testing/style: static checks found all new status extractors refer to response types with a status field and no changed Java lines over 120 columns. I did not run FE tests because this checkout is missing .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc.

User focus: no additional user-provided focus points were present.

Subagent conclusions: optimizer-rewrite proposed OPT-1, which became MAIN-1 and is submitted inline. tests-session-config proposed TSC-1 as a duplicate of OPT-1 with test coverage evidence, merged into MAIN-1. Convergence round 1 ended with both live subagents replying NO_NEW_VALUABLE_FINDINGS for the same ledger/comment set.

@mymeiyi

mymeiyi commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 6.80% (40/588) 🎉
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