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

   Breakwater-GitHub-Analysis-Slot: slot_ce2522762e32
   
   ### Assessment
   
   The nested-namespace failure is supported by the source: an external 
database name is incorrectly decoded before metadata lookup. This is an FE 
information-schema name-handling defect, with effects on table and column 
discovery. The issue is currently open and has no labels. I inspected the local 
`4.1.4.1` tag (`d2ffc9bcfa363287e4949829f4b8a2ee674149f7`) and the available 
upstream master snapshot (`2137067cccd3d647ffa36e6363e2365856864838`); I have 
not reproduced this against a running Doris/Nessie cluster.
   
   ### Verified code behavior
   
   - In `4.1.4.1`, `getDbNameFromMysqlTableSchema` returns the second component 
whenever a non-internal schema name splits into exactly two dot-separated 
components. Thus `gold.reporting` becomes `reporting`. With full schema names 
enabled, `cat.gold.reporting` has three components and is returned unchanged. 
Neither lookup names the actual database `gold.reporting`. The corresponding 
master helper has the same logic. See [release 
implementation](https://github.com/apache/doris/blob/d2ffc9bcfa363287e4949829f4b8a2ee674149f7/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java#L578)
 and [master 
helper](https://github.com/apache/doris/blob/2137067cccd3d647ffa36e6363e2365856864838/fe/fe-core/src/main/java/org/apache/doris/catalog/InfoSchemaDb.java#L39).
   - `information_schema.tables` passes the database-list schema string to 
`listTableStatus`, which decodes it before `catalog.getDbNullable`. 
`information_schema.columns` uses `getTableNames` and `describeTables`, which 
also apply this decoder. Fixing only `listTableStatus` would leave column 
discovery affected. `information_schema.schemata` can still list the namespace 
because database enumeration does not perform this inverse lookup.
   - `SHOW TABLE STATUS` is implemented as a query against the catalog's 
`information_schema.tables`, so it shares the failure. See 
[ShowTableStatusCommand](https://github.com/apache/doris/blob/d2ffc9bcfa363287e4949829f4b8a2ee674149f7/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowTableStatusCommand.java#L177).
 The reported `Database reporting does not exist in the remote system` warning 
is consistent with the incorrect lookup; it does not establish that the 
original namespace is absent.
   - The related metadata-loading concern is also supported, but “the whole 
database disappears whenever any table fails” needs qualification. 
`listTableStatus` calls `table.getComment()` unconditionally; Iceberg's 
implementation obtains table/view properties through metadata loading. Its 
exception handler surrounds the entire table loop: a failure stops processing 
subsequent tables, while already appended rows remain. A failure on the first 
processed table can therefore produce zero rows. Separately, 
`DatabaseIf.getTablesIgnoreException()` returns an empty list when table 
enumeration throws. These are distinct failure paths; the exact observed path 
needs the exception stack trace. See [status 
loop](https://github.com/apache/doris/blob/d2ffc9bcfa363287e4949829f4b8a2ee674149f7/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java#L666)
 and [enumeration 
fallback](https://github.com/apache/doris/blob/d2ffc9bcfa363287e4949829f4b8a2ee674149f7/fe/fe-core/src/main/j
 ava/org/apache/doris/catalog/DatabaseIf.java#L77).
   
   ### Recommended next steps
   
   1. Fix the shared schema-name conversion contract and audit its callers. 
Preserve complete external database names, and remove catalog qualification 
only when the caller actually supplied that representation. A generic split on 
dots is insufficient; even prefix stripping must account for a real namespace 
that starts with the catalog name. Prefer explicit raw database identity across 
internal RPC boundaries where feasible.
   2. Add regression coverage for one-, two-, and three-level namespaces, both 
settings of `show_full_dbname_in_info_schema_db`, internal catalogs, and a 
catalog-prefix/name collision. Verify `schemata`, `tables`, `columns`, and 
`SHOW TABLE STATUS` together, with appropriate schema filters for each setting 
and both administrative and restricted users.
   3. Track per-table metadata failure isolation separately. Define whether 
failed tables are omitted or returned with unavailable metadata, preserve 
healthy table results, and retain useful diagnostics. Test a broken table 
alongside healthy tables, including enumeration failures. Consider avoiding 
comment loading when it is not requested, after verifying the RPC projection 
contract.
   
   ### Information still needed
   
   For runtime confirmation and a release fix: provide the exact FE build 
commit, sanitized catalog DDL (including namespace/name-mapping options), and 
matching outputs of the reproduction queries with the effective full-name 
setting. Include a namespace named `reporting` in the inventory if one exists, 
since the erroneous lookup could resolve to a different database rather than 
return nothing. For the separate unreadable-table case, provide the complete FE 
warning and exception chain, the failing metadata operation, and a minimal 
healthy-plus-broken-table reproduction. No profile is needed to establish this 
name-conversion defect. No repository code was changed.
   


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