KAFKA-19432: Add an ERROR log message if broker.heartbeat.interval.ms is too large#20046
Conversation
… is too large Signed-off-by: PoAn Yang <payang@apache.org>
| " 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). " + |
There was a problem hiding this comment.
The message says "must be less than or equal to half", but the server does not actually stop. Perhaps the description could be phrased more clearly?
There was a problem hiding this 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}.")
There was a problem hiding this comment.
Yes, it would be better to fail fast. However, since session timeout is used by the quorum controller, the broker itself is not aware of the actual session timeout configured for the quorum controller. Perhaps we could improve the error message to make this distinction cleaer, incorporating the above explanation
There was a problem hiding this comment.
@FrankYang0529 any updates? it would be useful to remind users that session timeout is controlled by quorum controller rather than broker
There was a problem hiding this comment.
Sorry for late. Update it.
Signed-off-by: PoAn Yang <payang@apache.org>
Signed-off-by: PoAn Yang <payang@apache.org>
…is too large (apache#20046) * Log error message if `broker.heartbeat.interval.ms * 2` is large than `broker.session.timeout.ms`. * Add test case `testLogBrokerHeartbeatIntervalMsShouldBeLowerThanHalfOfBrokerSessionTimeoutMs`. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
broker.heartbeat.interval.ms * 2is large thanbroker.session.timeout.ms.testLogBrokerHeartbeatIntervalMsShouldBeLowerThanHalfOfBrokerSessionTimeoutMs.Reviewers: Chia-Ping Tsai chia7712@gmail.com