FrankYang0529 commented on code in PR #20046:
URL: https://github.com/apache/kafka/pull/20046#discussion_r2298260187
##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -513,6 +513,11 @@ class KafkaConfig private(doLog: Boolean, val props:
util.Map[_, _])
require(replicaFetchWaitMaxMs <= replicaLagTimeMaxMs,
"replica.fetch.wait.max.ms should always be less than or equal to
replica.lag.time.max.ms" +
" to prevent frequent changes in ISR")
+ if (brokerHeartbeatIntervalMs * 2 > brokerSessionTimeoutMs) {
+ error(s"${KRaftConfigs.BROKER_HEARTBEAT_INTERVAL_MS_CONFIG}
($brokerHeartbeatIntervalMs ms) must be less than or equal to half of the
${KRaftConfigs.BROKER_SESSION_TIMEOUT_MS_CONFIG} ($brokerSessionTimeoutMs ms).
" +
Review Comment:
@chia7712 do you think that it's better to throw error if
`broker.heartbeat.interval.ms` is larger than half of
`broker.session.timeout.ms`? Or we can change the error message like following:
```
error(s"${KRaftConfigs.BROKER_HEARTBEAT_INTERVAL_MS_CONFIG}
($brokerHeartbeatIntervalMs ms) is larger than half of the
${KRaftConfigs.BROKER_SESSION_TIMEOUT_MS_CONFIG} ($brokerSessionTimeoutMs ms).
" +
"If missing anyone heartbeat request, the broker loses broker lease.
" +
s"Please increase ${KRaftConfigs.BROKER_SESSION_TIMEOUT_MS_CONFIG}
or decrease ${KRaftConfigs.BROKER_HEARTBEAT_INTERVAL_MS_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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]