Skip to content

Commit

Permalink
KAFKA-18886: Log warnings only if the policy is explicitly defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganZhuZzz committed Mar 4, 2025
1 parent d75cc10 commit b93d475
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/kafka/server/KafkaConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ class KafkaConfig private(doLog: Boolean, val props: util.Map[_, _])
if (processRoles.contains(ProcessRole.BrokerRole)) s" Perhaps all listeners appear in ${KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG}?" else ""))
}
def warnIfConfigDefinedInWrongRole(expectedRole: ProcessRole, configName: String): Unit = {
warn(s"$configName is defined in ${processRoles.mkString(", ")}. It should be defined in the $expectedRole role.")
if (originals.containsKey(configName)) {
warn(s"$configName is defined in ${processRoles.mkString(", ")}. It should be defined in the $expectedRole role.")
}
}
if (processRoles == Set(ProcessRole.BrokerRole)) {
// KRaft broker-only
Expand Down

0 comments on commit b93d475

Please sign in to comment.