github-actions[bot] commented on code in PR #66600:
URL: https://github.com/apache/doris/pull/66600#discussion_r3746749640
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalDatabase.java:
##########
@@ -580,13 +580,17 @@ public CatalogIf getCatalog() {
@Override
public boolean registerTable(TableIf tableIf) {
makeSureInitialized();
- String tableName = tableIf.getName();
+ T table = (T) tableIf;
+ // Replayed metadata may lose these non-persistent owner references,
so restore them before publication.
+ table.setCatalog(extCatalog);
Review Comment:
`registerTable` is not the checkpoint/cache-recovery boundary described by
this PR. Its only production external caller,
`CatalogMgr.registerExternalTableFromEvent`, first calls
`buildTableForInit(..., hmsCatalog, db, false)`, whose constructor has already
installed these exact owners (and `nameMapping`), so these assignments are
no-ops there. Branch-4.0 recovery deliberately no longer persists external
database/table maps: the external meta caches are rebuilt lazily through
`buildDbForInit`/`buildTableForInit`, and no recovered table is routed through
this method. A standalone deserialized `ExternalTable` would also have a null
non-persistent `nameMapping`, which these two setters do not restore. Please
put complete invariant reconstruction on the real recovery/cache-load path (and
test that path), or demonstrate the production recovery caller that reaches
this method; the current test only clears fields manually and invokes an
event-only path.
--
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]