Gabriel39 commented on code in PR #71418:
URL: https://github.com/apache/doris/pull/71418#discussion_r4796386478


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java:
##########
@@ -477,23 +502,29 @@ public void alterCatalogProps(String catalogName, 
Map<String, String> newPropert
             // taking the global catalog write lock, then retry if another 
ALTER changed the snapshot.
             boolean validatedWithoutMutation = catalog instanceof 
ExternalCatalog
                     && validateCatalogPropsBeforeUpdate((ExternalCatalog) 
catalog, oldProperties, preparedUpdates);
-            Runnable resourceCleanup = () -> { };
-            writeLock();
-            try {
-                if (nameToCatalog.get(catalogName) != catalog
-                        || !oldProperties.equals(catalog.getProperties())) {
-                    continue;
+            Map<String, String> validatedUpdates = preparedUpdates;
+            try (CatalogPropertyUpdate update = new CatalogPropertyUpdate()) {
+                // Initialization holds the catalog monitor during remote IO. 
Wait without the manager lock,
+                // then recheck the same identity and properties before 
publishing the validated update.
+                this.<DdlException>withCatalogForMutation(() -> 
nameToCatalog.get(catalogName), current -> {

Review Comment:
   Fixed in 25c09dc44074. The supplier now filters by the validated catalog 
identity before the helper selects a monitor, while identity and property 
snapshot checks remain under the locks. A deterministic test holds replacement 
initialization blocked and verifies the stale ALTER rejects its type before 
that initialization is released, with no property publication or ALTER journal 
record. All 178 standard FE cases, the FE build and strict Checkstyle pass.



-- 
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]

Reply via email to