-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
KAFKA-18533: Remove KafkaConfig zookeeper related logic #18547
Conversation
# Conflicts: # core/src/main/scala/kafka/server/KafkaConfig.scala
# Conflicts: # core/src/main/scala/kafka/server/DynamicBrokerConfig.scala # core/src/main/scala/kafka/server/KafkaConfig.scala # core/src/main/scala/kafka/server/MetadataSupport.scala # core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala
# Conflicts: # core/src/main/scala/kafka/controller/KafkaController.scala
This PR seems to be adding an empty Kafka controller file. |
val zkConnectionTimeoutMs: Int = | ||
Option(getInt(ZkConfigs.ZK_CONNECTION_TIMEOUT_MS_CONFIG)).map(_.toInt).getOrElse(getInt(ZkConfigs.ZK_SESSION_TIMEOUT_MS_CONFIG)) | ||
val zkEnableSecureAcls: Boolean = getBoolean(ZkConfigs.ZK_ENABLE_SECURE_ACLS_CONFIG) | ||
val zkMaxInFlightRequests: Int = getInt(ZkConfigs.ZK_MAX_IN_FLIGHT_REQUESTS_CONFIG) |
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.
Can we also remove them from ZkConfigs
?
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.
Thanks for the PR, left a few comments.
contextLabels.put(BrokerIdLabel, config.brokerId.toString) | ||
} | ||
|
||
contextLabels.put(BrokerIdLabel, config.brokerId.toString) |
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.
Hmm, this seems like a bug - we may want to add a unit test if nothing failed. We should be setting NodeIdLabel
, not BrokerIdLabel
. Right?
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.
In ServerTest.scala will test this bug, I think we won't need to add a new test for it.
@@ -734,7 +723,7 @@ class KafkaConfig private(doLog: Boolean, val props: util.Map[_, _]) | |||
|
|||
val listenerNames = listeners.map(_.listenerName).toSet | |||
if (processRoles.isEmpty || processRoles.contains(ProcessRole.BrokerRole)) { | |||
// validations for all broker setups (i.e. ZooKeeper and KRaft broker-only and KRaft co-located) | |||
// validations for all broker setups (i.e. KRaft broker-only and KRaft co-located) |
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.
Shall we remove KRaft
?
@@ -4082,7 +4082,7 @@ object PlaintextAdminIntegrationTest { | |||
new AlterConfigOp(new ConfigEntry(TopicConfig.COMPRESSION_TYPE_CONFIG, "lz4"), OpType.SET) | |||
)) | |||
alterConfigs.put(topicResource2, util.Arrays.asList(new AlterConfigOp(new ConfigEntry(TopicConfig.COMPRESSION_TYPE_CONFIG, "snappy"), OpType.SET))) | |||
alterConfigs.put(brokerResource, util.Arrays.asList(new AlterConfigOp(new ConfigEntry(ZkConfigs.ZK_CONNECT_CONFIG, "localhost:2181"), OpType.SET))) | |||
alterConfigs.put(brokerResource, util.Arrays.asList(new AlterConfigOp(new ConfigEntry(KRaftConfigs.NODE_ID_CONFIG, "123"), OpType.SET))) |
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.
Hmm, it would be weird to update the node id, can we pick a config that makes more sense to update? Same for other cases similar to this one.
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.
@m1a2st thanks for this cleanup. please take a look at one small comment
@@ -152,11 +132,6 @@ public final class ZkConfigs { | |||
} | |||
|
|||
public static final ConfigDef CONFIG_DEF = new ConfigDef() | |||
.define(ZK_CONNECT_CONFIG, STRING, null, HIGH, ZK_CONNECT_DOC) |
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 those configs to zk2kraft.html
?
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.
import static org.apache.kafka.common.config.ConfigDef.Type.BOOLEAN; | ||
import static org.apache.kafka.common.config.ConfigDef.Type.INT; | ||
import static org.apache.kafka.common.config.ConfigDef.Type.LIST; | ||
import static org.apache.kafka.common.config.ConfigDef.Type.PASSWORD; | ||
import static org.apache.kafka.common.config.ConfigDef.Type.STRING; | ||
|
||
public final class ZkConfigs { |
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.
open https://issues.apache.org/jira/browse/KAFKA-18631 to remove this config file
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.
LGTM and one small comment remains
if (config.usesSelfManagedQuorum) { | ||
contextLabels.put(NodeIdLabel, config.nodeId.toString) | ||
} else { | ||
contextLabels.put(BrokerIdLabel, config.brokerId.toString) |
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.
Please remove BrokerIdLabel
and MockMetricsReporter.BROKERID
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.
addressed it :)
this PR is related to zk configs cleanup, so I'm going to backport to 4.0 |
Reviewers: Ismael Juma <[email protected]>, Chia-Ping Tsai <[email protected]>
Reviewers: Ismael Juma <[email protected]>, Chia-Ping Tsai <[email protected]>
Reviewers: Ismael Juma <[email protected]>, Chia-Ping Tsai <[email protected]>
as title
Committer Checklist (excluded from commit message)