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

   ### Background
   
   The legacy FE metadata endpoint serves the column list used when browsing a 
table or view. An asynchronous materialized view has its own base index, which 
holds the view's columns in schema order.
   
   ### What problem does this PR solve?
   
   Issue Number: close #70778
   Related PR: None
   PR Type: Bugfix
   
   Problem Summary:
   
   Opening the column list for an async materialized view can return HTTP 200 
with error code 500 and a `getSchema()` null pointer, even when SQL `DESC` 
returns the columns. The endpoint now looks up the view's actual base index. 
The regression test requests the legacy route and checks the view's own column 
aliases in order.
   
   ### Details
   
   - **Frequency:** Reproduced on every request to a projection view and an 
aggregate view on Doris 4.1.5, with and without `with_mv=1`.
   - **Root cause:** The handler used the base index ID only for tables of type 
`OLAP`. Async views have type `MATERIALIZED_VIEW`, so it passed `tableId - 1` 
to `IndexInfoProcDir`, which expects a real index ID for both types.
   - **Why existing tests missed it:** `test_http_legacy_meta_auth` exercises 
the legacy route with an ordinary table. `TableSchemaActionTest` exercises a 
different controller.
   - **Fix:** Use the same `isManagedTable()` predicate as the index lookup 
when choosing the base index ID.
   - **Other paths and branches:** The change is confined to the base schema 
lookup. Source inspection found the same condition on master and branches 2.1, 
3.0, 3.1, 4.0, 4.1 and 4.2. Runtime tests used 4.1.5.
   
   ### Testing
   
   - Compared two local Doris 4.1.5 instances. In the candidate, only the FE 
controller was recompiled from the release source with this change. Tested an 
ordinary table, a projection view and an aggregate view, each with and without 
`with_mv=1`. Before the fix, both table requests succeeded and all four view 
requests returned error code 500. With the fix, all six returned code 0 and the 
same ordered field names as SQL `DESC`.
   - Ran the new projection-view Groovy suite source against both instances 
using a lightweight local DSL adapter. The assertion on the response code 
failed on the original image. All four assertions passed on the candidate, 
including the base flag and the ordered aliases `mv_key`, `mv_value`. The 
aggregate view was tested manually. The ordinary table in the matrix had no 
synchronous rollup.
   - Ran `mvn checkstyle:check -pl fe-core` on the master-based working tree. 
Checkstyle reported zero violations.
   
   ### Release note
   
   The legacy FE schema API now returns the column list for asynchronous 
materialized views.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: the official regression runner 
stopped at its JDK 17 prerequisite, and the master FE build requires the 
missing project-provided protoc.
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex
   - Generated: The one-line FE fix, the regression test, and this description.
   - Human review: Patch and test 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