mingyen066 commented on code in PR #21522:
URL: https://github.com/apache/kafka/pull/21522#discussion_r2894701762


##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -358,9 +358,22 @@ class KafkaConfig private(doLog: Boolean, val props: 
util.Map[_, _])
     if (!protocols.contains(GroupType.CLASSIC)) {
       throw new ConfigException(s"Disabling the '${GroupType.CLASSIC}' 
protocol is not supported.")
     }
-    if (protocols.contains(GroupType.SHARE)) {
+    if (doLog && protocols.contains(GroupType.SHARE)) {
       warn(s"'${GroupType.SHARE}' in 
${GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG} is 
deprecated. " +
-        s"Share groups are controlled by the 'share.version' feature; this 
broker config will be ignored in a future release.")
+        s"Share groups are controlled by the 'share.version' feature. " +
+        s"This config will be removed in Kafka 5.0.")
+    }
+    if (doLog) {
+      val defaultProtocols = 
GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT
+        .asScala.map(_.toUpperCase).map(GroupType.valueOf).toSet
+      val missingProtocols = defaultProtocols -- protocols
+      if (missingProtocols.nonEmpty) {
+        warn(s"The config 
`${GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG}` is 
deprecated and will be removed in Kafka 5.0. " +

Review Comment:
   Right, fixed with originals().



##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -358,9 +358,22 @@ class KafkaConfig private(doLog: Boolean, val props: 
util.Map[_, _])
     if (!protocols.contains(GroupType.CLASSIC)) {
       throw new ConfigException(s"Disabling the '${GroupType.CLASSIC}' 
protocol is not supported.")
     }
-    if (protocols.contains(GroupType.SHARE)) {
+    if (doLog && protocols.contains(GroupType.SHARE)) {
       warn(s"'${GroupType.SHARE}' in 
${GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG} is 
deprecated. " +
-        s"Share groups are controlled by the 'share.version' feature; this 
broker config will be ignored in a future release.")
+        s"Share groups are controlled by the 'share.version' feature. " +
+        s"This config will be removed in Kafka 5.0.")
+    }
+    if (doLog) {
+      val defaultProtocols = 
GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT
+        .asScala.map(_.toUpperCase).map(GroupType.valueOf).toSet
+      val missingProtocols = defaultProtocols -- protocols
+      if (missingProtocols.nonEmpty) {
+        warn(s"The config 
`${GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG}` is 
deprecated and will be removed in Kafka 5.0. " +

Review Comment:
   Right, fixed with `originals()`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to