mumrah commented on code in PR #12250:
URL: https://github.com/apache/kafka/pull/12250#discussion_r890686480
##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -1790,38 +1790,13 @@ class KafkaConfig private(doLog: Boolean, val props:
java.util.Map[_, _], dynami
// We keep the user-provided String as `MetadataVersion.fromVersionString`
can choose a slightly different version (eg if `0.10.0`
// is passed, `0.10.0-IV0` may be picked)
val interBrokerProtocolVersionString =
getString(KafkaConfig.InterBrokerProtocolVersionProp)
- val interBrokerProtocolVersion =
MetadataVersion.fromVersionString(interBrokerProtocolVersionString)
-
- val fetchRequestVersion: Short =
- if (interBrokerProtocolVersion.isAtLeast(IBP_3_1_IV0)) 13
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_7_IV1)) 12
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_3_IV1)) 11
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_1_IV2)) 10
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_0_IV1)) 8
- else if (interBrokerProtocolVersion.isAtLeast(IBP_1_1_IV0)) 7
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_11_0_IV1)) 5
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_11_0_IV0)) 4
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_10_1_IV1)) 3
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_10_0_IV0)) 2
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_9_0)) 1
- else 0
-
- val offsetForLeaderEpochRequestVersion: Short =
- if (interBrokerProtocolVersion.isAtLeast(IBP_2_8_IV0)) 4
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_3_IV1)) 3
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_1_IV1)) 2
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_0_IV0)) 1
- else 0
-
- val listOffsetRequestVersion: Short =
- if (interBrokerProtocolVersion.isAtLeast(IBP_3_0_IV1)) 7
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_8_IV0)) 6
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_2_IV1)) 5
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_1_IV1)) 4
- else if (interBrokerProtocolVersion.isAtLeast(IBP_2_0_IV1)) 3
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_11_0_IV0)) 2
- else if (interBrokerProtocolVersion.isAtLeast(IBP_0_10_1_IV2)) 1
- else 0
+ val interBrokerProtocolVersion = if (processRoles.isEmpty) {
Review Comment:
Yes we should fix those as well. I believe all the remaining usages are for
versions prior to 3.0-IV1, so in KRaft mode we can pass a static version
`3.0-IV1` (regardless of the actual MetadataVersion). Setting the IBP
statically to the minimum KRaft compatible version (when in KRaft mode) also
guards against any incorrect/inadvertent future usages of
config.interBrokerProtocolVersion.
Basically, the PR grew pretty large/complex when I was trying to include the
remaining conversions. WDYT about completing those in a separate PR?
--
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]