Skip to content
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

Merged
merged 18 commits into from
Jan 25, 2025

Conversation

m1a2st
Copy link
Contributor

@m1a2st m1a2st commented Jan 15, 2025

as title

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added triage PRs from the community core Kafka Broker small Small PRs labels Jan 15, 2025
@m1a2st
Copy link
Contributor Author

m1a2st commented Jan 15, 2025

requiresZookeeper should wait for #18483 and #18508

# 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
@ijuma
Copy link
Member

ijuma commented Jan 18, 2025

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)
Copy link
Member

@ijuma ijuma Jan 22, 2025

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?

@github-actions github-actions bot removed the triage PRs from the community label Jan 22, 2025
Copy link
Member

@ijuma ijuma left a 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)
Copy link
Member

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?

Copy link
Contributor Author

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)
Copy link
Member

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)))
Copy link
Member

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.

Copy link
Member

@chia7712 chia7712 left a 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)
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these config already on zk2kraft.html

截圖 2025-01-24 上午9 08 34

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 {
Copy link
Member

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

Copy link
Member

@chia7712 chia7712 left a 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)
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed it :)

@github-actions github-actions bot removed the small Small PRs label Jan 24, 2025
@chia7712 chia7712 merged commit c40e7a1 into apache:trunk Jan 25, 2025
9 checks passed
@mingyen066 mingyen066 mentioned this pull request Jan 25, 2025
3 tasks
@chia7712
Copy link
Member

this PR is related to zk configs cleanup, so I'm going to backport to 4.0

chia7712 pushed a commit that referenced this pull request Jan 25, 2025
pranavt84 pushed a commit to pranavt84/kafka that referenced this pull request Jan 27, 2025
airlock-confluentinc bot pushed a commit to confluentinc/kafka that referenced this pull request Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants