Skip to content

branch-4.0: [fix] Preserve CurrentConnected in frontends() TVF #61087#61532

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

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

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:09
@hello-stephen
Copy link
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?

@dataroaring dataroaring reopened this Mar 19, 2026
@hello-stephen
Copy link
Contributor

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.15% (1788/2259)
Line Coverage 64.48% (31971/49580)
Region Coverage 65.26% (15985/24496)
Branch Coverage 55.85% (8508/15234)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 46.15% (6/13) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.93% (19201/36278)
Line Coverage 36.10% (178826/495379)
Region Coverage 32.70% (138461/423490)
Branch Coverage 33.69% (60200/178695)

@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 71.40% (25357/35513)
Line Coverage 54.08% (267429/494493)
Region Coverage 51.43% (220019/427764)
Branch Coverage 53.06% (95153/179338)

@yiguolei
Copy link
Contributor

skip buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 20, 2026
@github-actions
Copy link
Contributor Author

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit 807e340 into branch-4.0 Mar 20, 2026
28 of 31 checks passed
@github-actions github-actions bot deleted the auto-pick-61087-branch-4.0 branch March 20, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants