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

   ### Background
   
   Flight SQL clients use `GetSqlInfo` to discover server and library metadata. 
Doris returns a FlightInfo ticket, and the client reads the requested values 
through DoGet.
   
   ### What problem does this PR solve?
   
   Issue Number: #67578
   Related PR: #68770 (same fix on branch-4.1), #24314 (introduced the 
hardcoded server version)
   PR Type: Bugfix
   
   Problem Summary:
   
   Clients always receive server version `1.0` and Arrow version `18.2.0` on 
master, even when the running FE and Arrow dependency have different versions. 
Report the FE build version with its short commit hash and the implementation 
version of the loaded Flight SQL library. Most of the diff adds three Flight 
RPC tests.
   
   Observed on the local build, for both all-info and explicit-code requests:
   
   | SqlInfo | Before | After |
   |---|---|---|
   | Server version | `1.0` | `doris-0.0.0-b706e757481` |
   | Arrow version | `18.2.0` | `19.0.0` |
   
   ### Details
   
   - **Frequency:** Always when requesting either version through `GetSqlInfo` 
on the unfixed master.
   - **Root cause:** `DorisFlightSqlProducer` registers literal versions in its 
`SqlInfoBuilder`, so metadata cannot follow the running build or loaded library.
   - **Why existing tests missed it:** `DorisFlightSqlProducerTest` covers 
session, prepare and error handling; `FlightSqlTableTypesTest` checks 
table-type RPC metadata. Neither asserts SqlInfo versions. Regression suites 
such as `test_session_options` and `test_get_tables_schema` exercise other 
Flight APIs and do not request SqlInfo.
   - **Fix:** Use the same FE version format as heartbeat metadata and read 
Arrow's loaded package implementation version. If the manifest version is 
missing or empty, return `unknown` and keep its info code registered so 
explicit requests still succeed.
   - **Other paths and branches:** Full and filtered requests share the same 
builder; no other production version registration was found. The server literal 
dates to #24314. Checked release heads: branch-3.1 and branch-4.0 still use 
literals; branch-4.1 and branch-4.2 already use runtime versions. This change 
targets master.
   
   ### Testing
   
   - Locally ran `run-fe-ut.sh` for `FlightSqlServerInfoTest`, 
`DorisFlightSqlProducerTest` and `FlightSqlTableTypesTest`: 21 passed, none 
skipped, with Arrow allocator debug checks enabled. The three new RPC tests all 
fail on the unfixed baseline because the version values differ.
   - Reran the three RPC tests with Flight SQL loaded from an exploded 
directory without a manifest, then a JAR with an empty implementation version: 
3/3 passed in each case, including explicit Arrow-version requests returning 
`unknown`.
   - Rebuilt and restarted the local FE in a single-FE/single-BE cluster. 
All-info, each version alone, and `[0, 1, 2]` GetFlightInfo/DoGet requests 
match independent `SHOW FRONTENDS` and the manifest of the Flight SQL JAR 
opened by the FE.
   
   ### Release note
   
   Fix stale server and Arrow library versions returned by Flight SQL 
GetSqlInfo.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: code, tests, and this description
   - Human review: not stated
   


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