github-actions[bot] commented on code in PR #66717:
URL: https://github.com/apache/doris/pull/66717#discussion_r3796838706
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalMetaCacheMgr.java:
##########
@@ -191,28 +201,123 @@ public DorisExternalMetaCache doris(long catalogId) {
}
public void prepareCatalog(long catalogId) {
- Map<String, String> catalogProperties =
findCatalogProperties(catalogId);
- if (catalogProperties == null) {
- logMissingCatalogSkip(catalogId, "prepareCatalog");
- return;
+ Lock lifecycleLock = catalogLifecycleLocks.get(catalogId);
+ lifecycleLock.lock();
+ try {
+ Map<String, String> catalogProperties =
findCatalogProperties(catalogId);
+ if (catalogProperties == null) {
+ logMissingCatalogSkip(catalogId, "prepareCatalog");
+ return;
+ }
+ Map<String, String> runtimeProperties =
sanitizeCatalogCachePropertiesForRuntime(
+ catalogId, catalogProperties);
+ routeCatalogEngines(catalogId, cache ->
cache.initCatalog(catalogId, runtimeProperties));
+ } finally {
+ lifecycleLock.unlock();
}
- routeCatalogEngines(catalogId, cache -> cache.initCatalog(catalogId,
catalogProperties));
}
public void prepareCatalogByEngine(long catalogId, String engine) {
- Map<String, String> catalogProperties =
findCatalogProperties(catalogId);
- if (catalogProperties == null) {
- logMissingCatalogSkip(catalogId, "prepareCatalogByEngine");
+ ExternalMetaCache targetCache = this.engine(engine);
+ if (targetCache.isCatalogInitialized(catalogId)) {
Review Comment:
[P2] Close the prepare-to-entry removal gap
When this sees an initialized group it returns without the lifecycle stripe.
The typed accessor then returns the engine singleton, and its actual
`EntryHandle.get()` happens later. A successful cache-policy ALTER can remove
the group in that gap, making `requireCatalogEntryGroup()` throw even though
the catalog remains valid. The captured-group test starts after `entry()` has
already read the group, so it misses this window. Please make preparation and
group capture atomic, or retry capture after concurrent policy retirement.
--
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]