github-actions[bot] commented on code in PR #69252:
URL: https://github.com/apache/doris/pull/69252#discussion_r4313719820


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java:
##########
@@ -779,17 +779,8 @@ public ExternalDatabase<? extends ExternalTable> 
getDbNullable(String dbName) {
         if (StringUtils.isEmpty(dbName)) {
             return null;
         }
-        try {
-            makeSureInitialized();
-        } catch (Exception e) {
-            String diagnosticTrace = initErrorStackTrace(e);
-            if (diagnosticTrace != null) {
-                LOG.warn("failed to get db {} in catalog {}: {}", dbName, 
name, diagnosticTrace);
-            } else {
-                LOG.warn("failed to get db {} in catalog {}", dbName, name, e);
-            }
-            return null;
-        }
+        // Initialization errors do not establish that the requested database 
is absent.
+        makeSureInitialized();

Review Comment:
   [P2] Defer failed optional database lookup in the HTTP SQL callers
   
   `StmtExecutionAction.querySchema()` and `executeSQL()` still call 
`setDatabase(dbName)` before analyzing or submitting the SQL. With `ext.db` 
unavailable after a catalog reset, an authenticated `POST 
/api/query_schema/ext/db` containing `SELECT * FROM internal.db.t` now throws 
here before analyzing the healthy, fully qualified table; previously the null 
fallback allowed it through. `/api/query/ext/db` likewise blocks `REFRESH 
CATALOG ext` or credential-repair `ALTER CATALOG ext ...` before submission 
(with a healthy `internal.db` too, since the worker's JDBC URL selects that 
database). These HTTP entry points are separate from the repaired forwarding 
path. Retain the request's default namespace without remote IO, or defer failed 
optional lookup in these callers while preserving errors on actual database 
access, and cover both endpoints with outage tests.



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