github-actions[bot] commented on code in PR #67417:
URL: https://github.com/apache/doris/pull/67417#discussion_r4055929297
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/metacache/MetaCache.java:
##########
@@ -74,44 +164,318 @@ public MetaCache(String name,
maxSize,
true,
null);
- namesCache = namesCacheFactory.buildCache(namesCacheLoader, executor);
+ namesCache = namesCacheFactory.buildCache();
// Use sync removal listener to prevent deadlock (removal listener
calls invalidateAll)
// NOTE: This cache should NOT use refreshAfterWrite, as it would
become synchronous
metaObjCache =
objCacheFactory.buildCacheWithSyncRemovalListener(metaObjCacheLoader,
removalListener);
}
public List<String> listNames() {
- return
Objects.requireNonNull(namesCache.get("")).stream().map(Pair::value).collect(Collectors.toList());
+ return
getNames(false).stream().map(Pair::value).collect(Collectors.toList());
+ }
+
+ public List<String> refreshNames() {
+ throwIfInterrupted();
+ // Retire any active load so the forced refresh is not blocked behind
a stuck
+ // background refresh. Only advance the generation when the active
load is still
+ // running (not done); a completed load has already been cleared by
finishNamesLoad
+ // and cannot publish stale results.
+ synchronized (namesMutationLock) {
+ if (activeNamesLoad != null && !activeNamesLoad.result.isDone()) {
+ advanceNamesGeneration();
+ }
+ activeNamesLoad = null;
+ physicalNamesLoads.clear();
Review Comment:
[P1] Keep forced refreshes inside the physical-load bound
Retiring `activeNamesLoad` only completes its future; it cannot stop the
owner still blocked in `namesCacheLoader.load()`. Clearing `physicalNamesLoads`
here therefore forgets that live RPC, so each concurrent case-insensitive miss
can retire the latest replacement, clear the accounting again, and start
another physical load. The ordinary event/reset path now retains obsolete
owners and is capped, but this forced path bypasses that cap and can accumulate
one stuck connector call/request thread per miss. Please retain still-running
owners (or actually cancel and confirm them) and add a regression with more
than `MAX_PHYSICAL_NAMES_LOADS` concurrent `refreshNames()` calls while every
earlier loader remains blocked.
--
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]