kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject [kafka] branch 3.0 updated: KAFKA-13160: Fix bug in BrokerMetadataPublisher handling of default resources (#11168)
Date Wed, 04 Aug 2021 23:47:52 GMT
This is an automated email from the ASF dual-hosted git repository.

cmccabe pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 92b08ff  KAFKA-13160: Fix bug in BrokerMetadataPublisher handling of default resources
(#11168)
92b08ff is described below

commit 92b08ff8ad0b17f0353138497f3ccaea73f7e350
Author: Ryan Dielhenn <35785891+dielhennr@users.noreply.github.com>
AuthorDate: Wed Aug 4 16:43:49 2021 -0700

    KAFKA-13160: Fix bug in BrokerMetadataPublisher handling of default resources (#11168)
    
    When dealing with the default resource, BrokerMetadataPublisher should translate its name
from the empty
    string (KRaft convention) to "<default>" (ZK convention). In the long term, we should
eventually move from
    using a string to this for using an Option[String].
    
    Reviewers: Colin P. McCabe <cmccabe@apache.org>
---
 .../scala/kafka/server/metadata/BrokerMetadataPublisher.scala     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala b/core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala
index f1466e1..939251b 100644
--- a/core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala
+++ b/core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala
@@ -21,7 +21,7 @@ import kafka.coordinator.group.GroupCoordinator
 import kafka.coordinator.transaction.TransactionCoordinator
 import kafka.log.{Log, LogManager}
 import kafka.server.ConfigType
-import kafka.server.{ConfigHandler, FinalizedFeatureCache, KafkaConfig, ReplicaManager, RequestLocal}
+import kafka.server.{ConfigEntityName, ConfigHandler, FinalizedFeatureCache, KafkaConfig,
ReplicaManager, RequestLocal}
 import kafka.utils.Logging
 import org.apache.kafka.common.TopicPartition
 import org.apache.kafka.common.config.ConfigResource
@@ -203,7 +203,11 @@ class BrokerMetadataPublisher(conf: KafkaConfig,
           }
           tag.foreach { t =>
             val newProperties = newImage.configs().configProperties(configResource)
-            dynamicConfigHandlers(t).processConfigChanges(configResource.name(), newProperties)
+            val maybeDefaultName = configResource.name() match {
+              case "" => ConfigEntityName.Default 
+              case k => k
+            }
+            dynamicConfigHandlers(t).processConfigChanges(maybeDefaultName, newProperties)
           }
         }
       }

Mime
View raw message