github-actions[bot] commented on code in PR #64160:
URL: https://github.com/apache/doris/pull/64160#discussion_r3773152895
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/RefreshManager.java:
##########
@@ -175,42 +184,58 @@ public void replayRefreshTable(ExternalObjectLog log) {
return;
}
boolean hasDbName = !Strings.isNullOrEmpty(log.getDbName());
+ boolean hasTableName = !Strings.isNullOrEmpty(log.getTableName());
+ boolean isRename = !Strings.isNullOrEmpty(log.getNewTableName());
String localDbName = hasDbName
? log.getDbName()
: catalog.getDbNameForReplay(log.getDbId()).orElse(null);
Optional<ExternalDatabase<? extends ExternalTable>> db =
localDbName == null ? Optional.empty() :
catalog.getDbForReplay(localDbName);
+ // Rename logs carry names but no IDs. Rebuild the old table identity
used by the row-count cache.
+ long dbIdForInvalidation = isRename && hasDbName
+ ? Util.genIdByName(catalog.getName(), localDbName)
+ : log.getDbId();
+ long tableIdForInvalidation = isRename && hasDbName && hasTableName
Review Comment:
**[P1] Evict the rename destination row-count identity during replay**
This derives only the old table's ID. The coordinator's
`afterExternalRename` now invalidates both the retained source ID and
`Util.genIdByName(..., newTableName)`, but all replay states remove only the
source: cold/uninitialized branches use `tableIdForInvalidation`, and the hot
branch relies on `unregisterTable(old)` before returning. If a follower still
has a count cached for an earlier `db.t2`, replaying `RENAME t1 TO t2` reuses
the deterministic `t2` ID and serves that prior incarnation without reloading.
Please derive the local destination ID and make its row-count eviction the
final barrier in hot, cold-database, and uninitialized replay, with a
real-cache test that preseeds different source/destination counts.
--
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]