junrao commented on code in PR #21005:
URL: https://github.com/apache/kafka/pull/21005#discussion_r2578825926


##########
core/src/main/scala/kafka/server/ControllerApis.scala:
##########
@@ -720,47 +721,76 @@ class ControllerApis(
     val configChanges = new util.HashMap[ConfigResource,
       util.Map[String, Entry[AlterConfigOp.OpType, String]]]()
     val brokerLoggerResponses = new 
util.ArrayList[AlterConfigsResourceResponse](1)
+    val nullConfigsErrorResults = new 
util.IdentityHashMap[AlterConfigsResource, ApiError]()
     alterConfigsRequest.data.resources.forEach { resource =>
-      val configResource = new ConfigResource(
-        ConfigResource.Type.forId(resource.resourceType), 
resource.resourceName())
-      if (configResource.`type`().equals(ConfigResource.Type.BROKER_LOGGER)) {
-        val apiError = try {
-          runtimeLoggerManager.applyChangesForResource(
-            authHelper.authorize(request.context, CLUSTER_ACTION, CLUSTER, 
CLUSTER_NAME),
-            alterConfigsRequest.data().validateOnly(),
-            resource)
-          ApiError.NONE
-        } catch {
-          case t: Throwable => ApiError.fromThrowable(t)
+      try {
+        val nullUpdates = new util.ArrayList[String]()

Review Comment:
   Also, there are quite a few pre-processing checks in ConfigAdminManager.  
The doc says the following. Could we restructure the code between 
ConfigAdminManager and ControllerApis to (1) avoid duplicates logic in 
verification (2) prevent missing verification in one of the two places in the 
future?
   
   ```
           // BROKER_LOGGER requests always go to a specific, constant broker 
or controller node.
           //
           // BROKER resource changes for a specific (non-default) resource go 
to either that specific
           // node (if using bootstrap.servers), or directly to the active 
controller (if using
           // bootstrap.controllers)
           //
           // All other requests go to the least loaded broker (if using 
bootstrap.servers) or the
           // active controller (if using bootstrap.controllers)
   
   ```



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

Reply via email to