github-actions[bot] commented on code in PR #65126:
URL: https://github.com/apache/doris/pull/65126#discussion_r3642519993
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalDatabase.java:
##########
@@ -526,51 +542,44 @@ public T getTableNullable(String tableName) {
if (finalName == null) {
return null;
}
- // must use full qualified name to generate id.
- // otherwise, if 2 databases have the same table name, the id will be
the same.
- return metaCache.getMetaObj(finalName,
- Util.genIdByName(extCatalog.getName(), name,
finalName)).orElse(null);
+ T table = tables.get(finalName);
+ if (table != null) {
+ tableIdToName.put(table.getId(), finalName);
Review Comment:
**[P2] Keep ID publication ordered with object invalidation**
This now writes `tableIdToName` after every named lookup, outside the object
entry's publication/invalidation protocol. A hot lookup can read
`tables.get(finalName)`, then a concurrent DROP/rename can invalidate the
object and remove its ID entry, and this `put` runs afterward and restores only
the dropped name. The manual-miss path has the same gap when `MetaCacheEntry`
rejects cache publication after a generation change but still returns the
loaded object. `ExternalCatalog.getDbNullable(String)` has the identical
ordering for `dbIdToName`.
Please linearize the ID-map update with successful object
publication/invalidation (including generation-rejected loads), and add
deterministic hit-vs-drop and miss-load-vs-drop tests for both database and
table entries. Otherwise by-ID lookups retain stale navigation and repeatedly
reload an object that cleanup already removed.
--
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]