wenzhenghu commented on code in PR #65126:
URL: https://github.com/apache/doris/pull/65126#discussion_r3607110657


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalDatabase.java:
##########
@@ -650,15 +773,12 @@ public CatalogIf getCatalog() {
     @Override
     public boolean registerTable(TableIf tableIf) {
         makeSureInitialized();
-        String tableName = tableIf.getName();
+        T table = (T) tableIf;
         if (LOG.isDebugEnabled()) {
-            LOG.debug("create table [{}]", tableName);
+            LOG.debug("create table [{}]", table.getName());
         }
         if (isInitialized()) {
-            String localName = extCatalog.fromRemoteTableName(this.remoteName, 
tableName);
-            metaCache.updateCache(tableName, localName, (T) tableIf,
-                    Util.genIdByName(extCatalog.getName(), name, localName));
-            lowerCaseToTableName.put(tableName.toLowerCase(), tableName);
+            updateTableCache(table, table.getRemoteName(), table.getName());

Review Comment:
   Fixed in 3556798d392.
   
   I removed the HMSExternalDatabase.registerTable() override, so CREATE events 
no longer re-enter getTableNullable() after the superclass registration path. 
With cold names/object caches, the event now remains cache-only under 
db.writeLock(): it updates the retained ID state without triggering 
listTableNames() or other remote HMS I/O.
   
   I also updated the FE test to exercise the real HMSExternalDatabase 
production path instead of overriding registerTable() in the fixture. The 
cold-cache test now asserts that no load-through lookup happens, names/object 
caches stay cold, and the retained ID mapping is updated. A hot-object test 
also verifies that the event-provided updateTime is preserved when the event 
object replaces an existing cached table.



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