-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-16938: non-dynamic props gets corrupted due to circular reference between DynamicBrokerConfig and DynamicConfig. #16302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
0658846
88ac773
a59fa3f
e27c225
40e992c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |
|
|
||
| package kafka.server | ||
|
|
||
| import kafka.server.DynamicBrokerConfig.AllDynamicConfigs | ||
|
|
||
| import java.net.{InetAddress, UnknownHostException} | ||
| import java.util.Properties | ||
| import org.apache.kafka.common.config.ConfigDef | ||
|
|
@@ -30,10 +32,20 @@ import scala.jdk.CollectionConverters._ | |
| * and can only be set dynamically. | ||
| */ | ||
| object DynamicConfig { | ||
| object Broker { | ||
| private val brokerConfigs = { | ||
| val configs = QuotaConfigs.brokerQuotaConfigs() | ||
|
|
||
| // Filter and define all dynamic configurations | ||
| KafkaConfig.configKeys | ||
| .filter { case (configName, _) => AllDynamicConfigs.contains(configName) } | ||
| .foreach { case (_, config) => configs.define(config) } | ||
| configs | ||
| } | ||
|
|
||
| object Broker { | ||
| private val brokerConfigs = QuotaConfigs.brokerQuotaConfigs() | ||
| DynamicBrokerConfig.addDynamicConfigs(brokerConfigs) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, I will remove it 😄 |
||
| // Non-dynamic properties are determined by subtracting dynamic broker config names from all config names. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key point is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, I will modify it soon. |
||
| // This is to avoid circular reference issues during initialization. | ||
| val nonDynamicProps: Set[String] = KafkaConfig.configNames.toSet -- brokerConfigs.names.asScala | ||
|
|
||
| def configKeys: util.Map[String, ConfigDef.ConfigKey] = brokerConfigs.configKeys | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add comments to remind readers about the circular reference?