chia7712 commented on code in PR #18508:
URL: https://github.com/apache/kafka/pull/18508#discussion_r1915664998


##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -986,37 +966,13 @@ class DynamicListenerConfig(server: KafkaBroker) extends 
BrokerReconfigurable wi
     DynamicListenerConfig.ReconfigurableConfigs
   }
 
-  private def listenerRegistrationsAltered(
-    oldAdvertisedListeners: Map[ListenerName, EndPoint],
-    newAdvertisedListeners: Map[ListenerName, EndPoint]
-  ): Boolean = {
-    if (oldAdvertisedListeners.size != newAdvertisedListeners.size) return true
-    oldAdvertisedListeners.foreachEntry {
-      case (oldListenerName, oldEndpoint) =>
-        newAdvertisedListeners.get(oldListenerName) match {
-          case None => return true
-          case Some(newEndpoint) => if (!newEndpoint.equals(oldEndpoint)) {
-            return true
-          }
-        }
-    }
-    false
-  }
-
-  private def verifyListenerRegistrationAlterationSupported(): Unit = {
-    if (!server.config.requiresZookeeper) {
-      throw new ConfigException("Advertised listeners cannot be altered when 
using a " +
-        "Raft-based metadata quorum.")
-    }
-  }
-
   def validateReconfiguration(newConfig: KafkaConfig): Unit = {
     val oldConfig = server.config
     val newListeners = listenersToMap(newConfig.listeners)
-    val newAdvertisedListeners = 
listenersToMap(newConfig.effectiveAdvertisedBrokerListeners)
+    val oldAdvertisedListeners = 
listenersToMap(oldConfig.effectiveAdvertisedBrokerListeners)

Review Comment:
   it seems we can use `Set` instead of `Map`, right?



##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -1032,15 +988,8 @@ class DynamicListenerConfig(server: KafkaBroker) extends 
BrokerReconfigurable wi
       if (oldConfig.effectiveListenerSecurityProtocolMap(listenerName) != 
newConfig.effectiveListenerSecurityProtocolMap(listenerName))
         throw new ConfigException(s"Security protocol cannot be updated for 
existing listener $listenerName")
     }
-    if (!newAdvertisedListeners.contains(newConfig.interBrokerListenerName))
+    if (!oldAdvertisedListeners.contains(newConfig.interBrokerListenerName))

Review Comment:
   Is `interBrokerListenerName` a kind of dynamic config? If not, `KafkaConfig` 
has checked it in initialization. 



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