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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalDatabase.java:
##########
@@ -743,6 +743,25 @@ protected void invalidateTableCache(String localTableName) 
{
         }
     }
 
+    /** Refreshes table membership and lookup identity without loading remote 
metadata. */
+    public void invalidateTableLookup(String tableName) {
+        if (!isInitialized()) {
+            return;
+        }
+        // In case-insensitive lookup mode an older spelling may still be 
loading while a refreshed
+        // names snapshot already contains the new spelling. Fence every 
object/ID load in this database.
+        if (isTableNamesCaseInsensitive()) {
+            invalidateAllTableCache();

Review Comment:
   [P2] Keep bulk ID cleanup ordered with object publication
   
   With `lower_case_table_names=2`, this new call can erase the ID of a freshly 
loaded table while leaving its object cached. `invalidateAllTableCache()` 
returns from `tables.invalidateAll()` before calling 
`tableIdNameIndex.clear()`. A concurrent `getTableNullable(String)` can run in 
that gap, load the current names/table and publish its object plus ID; the 
subsequent `clear()` then removes that new ID without removing the new object. 
After REFRESH completes, `getTableNullable(newTable.getId())` returns null, so 
`ExternalRowCountCache.loadRowCount()` cannot resolve the table and returns 
null; its caller yields `UNKNOWN_ROW_COUNT` until another lookup by name 
repairs the index. Keep bulk ID removal inside the object-publication barrier, 
and cover this interleaving with a deterministic concurrency test.



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