KAFKA-18533: Remove KafkaConfig zookeeper related logic#18547
KAFKA-18533: Remove KafkaConfig zookeeper related logic#18547chia7712 merged 18 commits intoapache:trunkfrom
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.
Can we also remove them from ZkConfigs?
ijuma
left a comment
There was a problem hiding this comment.
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.
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.
In ServerTest.scala will test this bug, I think we won't need to add a new test for it.
| 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) |
| )) | ||
| 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.
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.
| } | ||
|
|
||
| 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.
Could you please add those configs to zk2kraft.html?
| 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.
open https://issues.apache.org/jira/browse/KAFKA-18631 to remove this config file
chia7712
left a comment
There was a problem hiding this comment.
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.
Please remove BrokerIdLabel and MockMetricsReporter.BROKERID
|
this PR is related to zk configs cleanup, so I'm going to backport to 4.0 |
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
| props.setProperty(KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG, "CONTROLLER") | ||
| props.setProperty(KRaftConfigs.NODE_ID_CONFIG, "1") | ||
| props.setProperty(SocketServerConfigs.LISTENERS_CONFIG, "PLAINTEXT://localhost:0,CONTROLLER://localhost:5000") | ||
| props.setProperty(QuorumConfig.QUORUM_VOTERS_CONFIG, "2@localhost:5000") |
There was a problem hiding this comment.
this config is invalid. It uses combined mode so the id should be aligned with node.id. 2@localhost:5000 -> 1@localhost:5000 - otherwise, the test cases using this config will always get invalid KafkaConfig
@mingyen066 Could you please file a minor to fix it? @m1a2st is busy today
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>

as title
Committer Checklist (excluded from commit message)