github-actions[bot] commented on code in PR #66247:
URL: https://github.com/apache/doris/pull/66247#discussion_r3698519053


##########
fe/fe-core/src/main/java/org/apache/doris/connector/ConnectorPluginManager.java:
##########
@@ -433,6 +458,19 @@ public void validateProperties(String catalogType, 
Map<String, String> propertie
         }
     }
 
+    /** Validates an ALTER candidate through the matching provider without 
mutating catalog state. */
+    public void validatePropertiesForUpdate(String catalogType,
+            Map<String, String> currentProperties, Map<String, String> 
updatedProperties) {
+        for (ConnectorProvider provider : providers) {
+            Map<String, String> matchProperties = currentProperties == null
+                    ? Collections.emptyMap() : currentProperties;
+            if (provider.supports(catalogType, matchProperties)) {
+                provider.validatePropertiesForUpdate(currentProperties, 
updatedProperties);

Review Comment:
   [P2] Pin the plugin TCCL during ALTER validation
   
   This new path calls both `provider.supports(...)` and 
`provider.validatePropertiesForUpdate(...)` under the FE caller's 
thread-context classloader. Directory providers are loaded child-first, and 
update validators (including the default dispatch into `validateProperties`) 
may use `ServiceLoader` or by-name reflection for plugin-local classes; with 
the kernel TCCL they can miss those services or resolve split-brain classes and 
reject a valid `ALTER CATALOG`. The changed tests only use built-in/same-loader 
providers. Please run provider selection and update validation with 
`provider.getClass().getClassLoader()` pinned as the TCCL, restore it in 
`finally`, and cover an admitted directory provider whose update validator 
loads a plugin-local helper.



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