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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/BaseTableStream.java:
##########
@@ -198,7 +219,16 @@ public TableIf getBaseTableOrNereidsAnalysisException() 
throws AnalysisException
     }
 
     public List<String> getBaseTableFullQualifiers() {
-        return baseTableInfo.getFullQualifiers();
+        return getBaseTableFullQualifiers(getBaseTableNullable());
+    }
+
+    List<String> getBaseTableFullQualifiers(TableIf availableBaseTable) {
+        TableIf displayBaseTable = availableBaseTable;
+        if (displayBaseTable == null && baseTableInfo.isInternalTable()) {
+            displayBaseTable = 
Env.getCurrentRecycleBin().getRecycledTableNullable(
+                    baseTableInfo.getDbId(), baseTableInfo.getTableId());
+        }
+        return displayBaseTable == null ? baseTableInfo.getFullQualifiers() : 
displayBaseTable.getFullQualifiers();

Review Comment:
   **[P1] Resolve recycled qualifiers without the detached table's database 
pointer**
   
   This is distinct from the existing same-ID table-rename thread: after `DROP 
TABLE db.base`, `ALTER DATABASE db RENAME db2` updates `qualifiedDbName` only 
for active `Database.idToTable` entries. The recycled base therefore still 
resolves `getDatabase()` through `db`, which no longer exists. This line then 
calls the default `TableIf.getFullQualifiers()` and dereferences 
`getDatabase().getCatalog()`, so one stale stream aborts 
`information_schema.table_streams`, `SHOW CREATE STREAM`, and stream collection 
with an NPE instead of reporting disabled/stale. The stale name also survives 
image/replay; after recycle erasure, the descriptor fallback still reports `db`.
   
   Derive the internal catalog/database qualifiers from stable IDs/current 
live-or-recycled database identity, and preserve only the latest table name 
independently of the recycled object's lifetime; cover drop-base -> 
rename-database, reload, and recycle erasure.



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