nooneuse commented on code in PR #66307:
URL: https://github.com/apache/doris/pull/66307#discussion_r3748005083
##########
fe/fe-core/src/main/java/org/apache/doris/common/cache/NereidsSqlCacheManager.java:
##########
@@ -123,31 +142,79 @@ public void invalidateAboutTable(TableIf tableIf) {
);
}
}
+ return invalidateTableName;
+ }
- for (Entry<String, SqlCacheContext> kv : sqlCaches.asMap().entrySet())
{
- String key = kv.getKey();
- SqlCacheContext context = kv.getValue();
- for (Entry<FullTableName, TableVersion> nameToVersion :
context.getUsedTables().entrySet()) {
- FullTableName tableName = nameToVersion.getKey();
- TableVersion tableVersion = nameToVersion.getValue();
- if (tableVersion.id == tableIf.getId()) {
- invalidateKeys.add(key);
- break;
+ /** Invalidate table caches and fence publication using a persisted
qualified name. */
+ public void invalidateAboutTableAndFencePublication(TableNameInfo
tableNameInfo) {
+ invalidateAboutTable(-1L, new FullTableName(
+ tableNameInfo.getCtl(), tableNameInfo.getDb(),
tableNameInfo.getTbl()), true);
+ }
+
+ private void invalidateAboutTable(long tableId, FullTableName
invalidateTableName, boolean fencePublication) {
+ publicationLock.writeLock().lock();
+ try {
+ if (fencePublication) {
+ long invalidationSequence =
publicationSequence.incrementAndGet();
+ if (tableId >= 0) {
+ tableIdInvalidationSequences.put(tableId,
invalidationSequence);
Review Comment:
alright.
--
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]