ijuma commented on a change in pull request #11036: URL: https://github.com/apache/kafka/pull/11036#discussion_r672255739
########## File path: core/src/main/scala/kafka/log/LogManager.scala ########## @@ -403,27 +411,49 @@ class LogManager(logDirs: Seq[File], * Start the background threads to flush logs and do log cleanup */ def startup(topicNames: Set[String]): Unit = { - startupWithConfigOverrides(fetchTopicConfigOverrides(topicNames)) + // ensure consistency between default config and overrides + val defaultConfig = currentDefaultConfig + startupWithConfigOverrides(defaultConfig, fetchTopicConfigOverrides(defaultConfig, topicNames)) } // visible for testing - private[log] def fetchTopicConfigOverrides(topicNames: Set[String]): Map[String, LogConfig] = { + @nowarn("cat=deprecation") + private[log] def fetchTopicConfigOverrides(defaultConfig: LogConfig, topicNames: Set[String]): Map[String, LogConfig] = { val topicConfigOverrides = mutable.Map[String, LogConfig]() - val defaultProps = currentDefaultConfig.originals() + val defaultProps = defaultConfig.originals() topicNames.foreach { topicName => - val overrides = configRepository.topicConfig(topicName) + var overrides = configRepository.topicConfig(topicName) Review comment: Regarding unmodifiable `Properties`, there is no built-in way. My concern was something like the `MockConfigRepository` issue you found where copies are not done with the assumption that the caller should not mutate (even though there is no simple way to prevent that - another reason not to use `Properties`). -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org