satishd commented on code in PR #14381:
URL: https://github.com/apache/kafka/pull/14381#discussion_r1349603877


##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -1140,12 +1140,14 @@ class DynamicRemoteLogConfig(server: KafkaBroker) 
extends BrokerReconfigurable w
   override def validateReconfiguration(newConfig: KafkaConfig): Unit = {
     newConfig.values.forEach { (k, v) =>
       if (reconfigurableConfigs.contains(k)) {
-        val newValue = v.asInstanceOf[Long]
-        val oldValue = getValue(server.config, k)
-        if (newValue != oldValue) {
-          val errorMsg = s"Dynamic remote log manager config update validation 
failed for $k=$v"
-          if (newValue <= 0)
-            throw new ConfigException(s"$errorMsg, value should be at least 1")
+        if 
(k.equals(RemoteLogManagerConfig.REMOTE_LOG_INDEX_FILE_CACHE_TOTAL_SIZE_BYTES_PROP))
 {
+          val newValue = v.asInstanceOf[Long]
+          val oldValue = getValue(server.config, k)
+          if (newValue != oldValue) {
+            val errorMsg = s"Dynamic remote log manager config update 
validation failed for $k=$v"

Review Comment:
   Have this defined in the below if condition as it is used only for that. 
   
   ```
   if (newValue <= 0) {
     val errorMsg = s"Dynamic remote log manager config update validation 
failed for $k=$v"
     throw new ConfigException(s"$errorMsg, value should be at least 1")
   }
   ```



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to