Skip to content

branch-4.1: [fix] Preserve CurrentConnected in frontends() TVF #61087#61533

Merged
yiguolei merged 1 commit intobranch-4.1from
auto-pick-61087-branch-4.1
Mar 20, 2026
Merged

branch-4.1: [fix] Preserve CurrentConnected in frontends() TVF #61087#61533
yiguolei merged 1 commit intobranch-4.1from
auto-pick-61087-branch-4.1

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #61087

Cause:
- FRONTENDS() goes through metadata scan and may be generated on master
FE.
- In this path, currentConnectedFE context is not always preserved, so
CurrentConnected falls back to master and WHERE CURRENTCONNECTED='Yes'
always matches master.

Fix:
- Reuse TFrontendsMetadataParams.cluster_name as a pass-through slot to
carry the FE host that accepted the client connection from TVF planning
to metadata generation.
- Populate this host in FrontendsTableValuedFunction#getMetaScanRange
(prefer ConnectContext.currentConnectedFEIp, fallback to self host).
- Read and apply it in MetadataGenerator#frontendsMetadataResult via
FrontendsProcNode#getFrontendsInfo(env, infos, currentConnectedFeHost).
- Add comments at write/read points to explain why cluster_name is
reused for this pass-through.

Verification:
- FE UT: org.apache.doris.tablefunction.FrontendsTableValuedFunctionTest
@github-actions github-actions bot requested a review from yiguolei as a code owner March 19, 2026 17:10
@Thearas
Copy link
Contributor

Thearas commented Mar 19, 2026

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?

@dataroaring dataroaring reopened this Mar 19, 2026
@Thearas
Copy link
Contributor

Thearas commented Mar 19, 2026

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.54% (1786/2274)
Line Coverage 64.36% (31947/49641)
Region Coverage 65.16% (15984/24532)
Branch Coverage 55.75% (8507/15258)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.63% (19440/36937)
Line Coverage 36.07% (181758/503880)
Region Coverage 32.55% (140329/431092)
Branch Coverage 33.48% (61179/182715)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 70.96% (25658/36157)
Line Coverage 53.82% (270704/502939)
Region Coverage 51.36% (223582/435329)
Branch Coverage 52.64% (96507/183341)

@yiguolei yiguolei merged commit 8abec4d into branch-4.1 Mar 20, 2026
26 of 29 checks passed
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.

5 participants