github-actions[bot] commented on code in PR #67417:
URL: https://github.com/apache/doris/pull/67417#discussion_r4011111959
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/metacache/MetaCache.java:
##########
@@ -74,40 +162,303 @@ 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. The old load's connector call continues but its
result
+ // is discarded; its slot is freed so getNames(true) can start a fresh
load.
+ synchronized (namesMutationLock) {
+ if (activeNamesLoad != null) {
+ activeNamesLoad.result.complete(null);
Review Comment:
[P1] Fence the retired loader's successful publication
Completing and removing this owner does not actually discard its result: its
generation, minimum generation, and lifecycle epoch all remain current. A
forced replacement can therefore load and publish a newly created mixed-case
name, then the old loader can return afterward, pass the checks at lines
290-292, and overwrite both `namesCache` and the lowercase routing callback
with its pre-refresh snapshot; the failed `result.complete(value)` happens only
after publication. This is distinct from the earlier pre-wait/rejoin threads
because the replacement does run and succeed before the state is rolled back.
Please make retirement part of the publication predicate (or advance a
publication token), and test that an old loader finishing after the forced load
cannot change either names or routing.
--
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]