-
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-17616: Remove KafkaServer #18384
Changes from 1 commit
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 | ||
---|---|---|---|---|
|
@@ -699,20 +699,11 @@ class DynamicLogConfig(logManager: LogManager, server: KafkaBroker) extends Brok | |||
} | ||||
|
||||
override def reconfigure(oldConfig: KafkaConfig, newConfig: KafkaConfig): Unit = { | ||||
val originalLogConfig = logManager.currentDefaultConfig | ||||
val originalUncleanLeaderElectionEnable = originalLogConfig.uncleanLeaderElectionEnable | ||||
val newBrokerDefaults = new util.HashMap[String, Object](newConfig.extractLogConfigMap) | ||||
|
||||
logManager.reconfigureDefaultLogConfig(new LogConfig(newBrokerDefaults)) | ||||
|
||||
updateLogsConfig(newBrokerDefaults.asScala) | ||||
|
||||
if (logManager.currentDefaultConfig.uncleanLeaderElectionEnable && !originalUncleanLeaderElectionEnable) { | ||||
server match { | ||||
case kafkaServer: KafkaServer => kafkaServer.kafkaController.enableDefaultUncleanLeaderElection() | ||||
case _ => | ||||
} | ||||
} | ||||
} | ||||
} | ||||
|
||||
|
@@ -1068,8 +1059,7 @@ class DynamicListenerConfig(server: KafkaBroker) extends BrokerReconfigurable wi | |||
listenersToMap(newConfig.effectiveAdvertisedBrokerListeners))) { | ||||
verifyListenerRegistrationAlterationSupported() | ||||
server match { | ||||
case kafkaServer: KafkaServer => kafkaServer.kafkaController.updateBrokerInfo(kafkaServer.createBrokerInfo) | ||||
case _ => throw new RuntimeException("Unable to handle non-kafkaServer") | ||||
case _ => throw new RuntimeException("Unable to handle reconfigure") | ||||
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. If we always throw this exception, we probably don't need to do 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. 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. We should remove
That can disallow users to configure advertised listeners dynamically. 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. 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. There's a bunch of other ZooKeeper related logic in this class so I was planning to address them together in a follow up issue. Deleting 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'm ok to merge this and then address comments in the follow-up, because there are many cleanup blocked by KafkaServer 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'm ok with that, but let's file a JIRA so we don't lose track. 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 care particularly about the error messages and such things since they are not easy to find afterwards. 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 opened https://issues.apache.org/jira/browse/KAFKA-18405 with details about this issue. |
||||
} | ||||
} | ||||
} | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,8 @@ object KafkaBroker { | |
* you do change it, be sure to make it match that regex or the system tests will fail. | ||
*/ | ||
val STARTED_MESSAGE = "Kafka Server started" | ||
|
||
val MIN_INCREMENTAL_FETCH_SESSION_EVICTION_MS: Long = 120000 | ||
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. It's a bit odd that we're not following the Scala convention here. Since we're rewriting this stuff in Java anyway, maybe it's ok. |
||
} | ||
|
||
trait KafkaBroker extends Logging { | ||
|
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 not simply remove this class? It's not a public class and I don't think anything references it besides the relevant shell script.
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.
If the
KafkaServer
is still existent, we can't remove many unused classes/configs from code base. For example, zk configs andZkMetadataCache
. Do we have any use cases forKafkaServer
in 4.0?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.
I actually meant something else - I was asking whether we need to keep
kafka.Kafka
. The answer isyes
since it is still used for KRaft. But looking at this in more detail, this exception message doesn't make sense in a world where ZK is not supported since it will throw this when process roles is empty.We should simply remove this conditional code and leave it to
KafkaConfig
to throw the appropriate exception ifprocessRoles
is empty.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.
Sorry for misunderstanding your comment
make sense