Doris-Breakwater commented on issue #68994:
URL: https://github.com/apache/doris/issues/68994#issuecomment-6137814447

   The report identifies a confirmed FE URL-construction defect for raw IPv6 
backend addresses in the inspected source. The proposed 
`NetUtils.getHostPortInAccessibleFormat(host, httpPort)` approach addresses 
this failure. Suggested triage: FE administrative SQL / IPv6 compatibility. The 
issue is open and currently has no labels.
   
   **Verified evidence.** `ShowConfigCommand.handShowBackendConfig()` reads 
`Backend.getHost()` and `getHttpPort()`, interpolates them into 
`http://%s:%d/api/show_config`, and immediately calls `new URL(urlString)`. The 
unbracketed IPv6 literal makes Java interpret part of the address as the port. 
URL construction throws before the connection, `Auth-Token` header, or BE 
response processing; the catch block wraps this exception in the reported 
“Can't get backend config” message. This path is present in the inspected 
[master 
snapshot](https://github.com/apache/doris/blob/85ef38e0097ae8acb85ef8c2bdf970f9ea9803bf/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowConfigCommand.java#L125)
 and [branch-4.0 
snapshot](https://github.com/apache/doris/blob/8a9961723ea4be00cdf923c60759607202c7e2e7/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowConfigCommand.java#L125).
   
   An isolated check on JDK 17.0.16 reproduced `MalformedURLException` for 
`http://2001:db8::1234:8040/api/show_config`. Its message was `Error at index 0 
in: "db8::1234:8040"`; the numeric index differs from the report, but the 
malformed authority and failure stage match. The bracketed URL parsed with port 
`8040` and path `/api/show_config`.
   
   The [existing 
helper](https://github.com/apache/doris/blob/8a9961723ea4be00cdf923c60759607202c7e2e7/fe/fe-core/src/main/java/org/apache/doris/common/util/NetUtils.java#L145)
 brackets valid IPv6 literals and otherwise returns `host:port`. The 
registration parser removes the brackets from a bracketed backend host/port 
pair, so URL construction must restore them. I also inspected the locally 
available `4.0.3-rc03` source snapshot and exercised its exact helper method 
with the declared Commons Validator 1.9.0 dependency: IPv6 produced 
`[2001:db8::1234]:8040`, IPv4 produced `192.0.2.10:8040`, and a hostname 
produced `backend.example:8040`; all three resulting URLs parsed successfully. 
This verifies formatting and parsing, not a live Doris cluster or the 
reporter's deployed binary.
   
   **Impact and next step.** Both the all-backend and single-backend forms use 
this URL construction. In a mixed cluster, encountering one affected alive IPv6 
backend aborts the entire statement rather than returning the accumulated rows. 
`SHOW FRONTEND CONFIG` uses a separate local configuration path.
   
   The contributor's proposed PR can replace the URL expression with:
   
   ```java
   String urlString = "http://"; + NetUtils.getHostPortInAccessibleFormat(host, 
httpPort)
           + "/api/show_config";
   ```
   
   Add the `NetUtils` import and cover the command's URL construction, not only 
the helper:
   
   - IPv6 loopback, compressed, and full literals, plus IPv4 and hostname 
cases; verify the HTTP port and endpoint path.
   - An IPv6 BE serving `/api/show_config`; verify both all-backend and 
single-backend execution return configuration rows, including `LIKE` filtering.
   - A mixed IPv4/IPv6 cluster; verify the statement completes and preserves 
the existing result columns.
   
   After validation, maintainers can consider a backport to branch-4.0.
   
   **Remaining evidence.** The report is sufficient to proceed with a focused 
PR; no query profile is needed for this parsing failure. For exact release 
attribution, provide the FE build/commit identifier and JDK version. End-to-end 
success still needs the IPv6 cluster regression above. If failure persists with 
a correctly bracketed URL, provide the sanitized FE exception stack and 
relevant `SHOW BACKENDS` fields (`Host`, `HttpPort`, `Alive`), preserving 
address syntax. HTTP reachability, authentication, and BE response failures 
would then require separate evidence; this investigation does not establish 
those as causes.
   
   Breakwater-GitHub-Analysis-Slot: slot_7b2ced670047
   


-- 
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