sollhui opened a new pull request, #70910:
URL: https://github.com/apache/doris/pull/70910

   ### Background
   
   With follower planning enabled, the master FE selects a follower for a Group 
Commit Stream Load. The follower builds the plan and returns it through the 
master to the BE. The master therefore handles the full Thrift response for 
every forwarded request.
   
   ### What problem does this PR solve?
   
   Issue Number: None  
   Related PR: None  
   PR Type: Performance
   
   The master spends CPU receiving and serializing plans that the BE consumes. 
This change keeps follower selection and schema-change checks on the master and 
lets the selected follower return the plan directly to the BE.
   
   ### Details
   
   - **Why it was slow:** Forwarding the plan through the master requires an 
extra serialization and transfer of the plan payload.
   - **Optimization:** The BE requests a follower address from the master over 
HTTP using the cluster auth token, then calls the follower's existing 
`streamLoadPut` RPC. The follower checks the load request's credentials as 
usual.
   - **Results:** In the final steady interval of each three-FE monitoring 
trace, CPU utilization on the busiest FE was about **75–77% before** and 
**35–37% after**, a reduction of roughly **40 percentage points**. These 
readings compare steady load and exclude the brief startup spikes.
   - **Applicability and cost:** Direct planning requires follower forwarding 
to be enabled and a live follower. Group Commit loads incur a small route 
lookup on the master, with a timeout capped at 10 seconds. Older BEs keep using 
the master RPC. The BE also uses that path when the route is unavailable on an 
older FE, the master returns no follower, or the follower RPC has a transport 
failure.
   
   ### Testing
   
   - Ran a standalone C++ harness with a mocked HTTP client against the 
route-selection helper. Covered IPv6, form encoding, HTTP and HTTPS URL 
selection, redirects, legacy FE responses, error handling, and the RPC timeout 
cap.
   - Parsed the three changed Java sources and passed clang-format 16 and the 
BE build-hygiene checks.
   - Extended the three-FE regression to fail if a Group Commit load silently 
falls back to planning through the master, and to verify the loaded row count. 
The Docker daemon was unavailable locally. The full build stopped at the JDK 17 
environment check.
   
   ### Release note
   
   Group Commit Stream Load can reduce master FE CPU usage by fetching plans 
directly from follower FEs when follower planning is enabled.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes, planning traffic can go directly from the BE to a 
follower FE.
   - Does this need documentation: No.
   - Pre-submission status: Partially verified. Full build and Docker 
regression pending.
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex (GPT-6).
   - Generated: Port to master, regression adaptation, and PR description.
   - Human review: The author confirmed the before/after CPU comparison.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to