cmccabe commented on a change in pull request #10463: URL: https://github.com/apache/kafka/pull/10463#discussion_r612969287
########## File path: metadata/src/main/java/org/apache/kafka/controller/ConfigurationControlManager.java ########## @@ -374,6 +381,27 @@ void deleteTopicConfigs(String name) { configData.remove(new ConfigResource(Type.TOPIC, name)); } + private boolean getBoolean(ConfigResource configResource, String key) { + TimelineHashMap<String, String> map = configData.get(configResource); + if (map == null) return false; + String value = map.getOrDefault(key, "false"); + return value.equalsIgnoreCase("true"); + } + + /** + * Check if the given topic should use an unclean leader election. + * + * @param topicName The topic name. + * @return True if the controller or topic was configured to use unclean + * leader election. + */ + boolean shouldUseUncleanLeaderElection(String topicName) { Review comment: Thanks for finding this! I implemented leader election triggered by setting the unclean leader election config. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org