[英]Kafka producer config: Why request.timeout.ms should be larger than replica.lag.time.max.ms
From Kafka doc https://kafka.apache.org/11/documentation.html#producerconfigs , it says that:来自 Kafka doc https://kafka.apache.org/11/documentation.html#producerconfigs ,它说:
The configuration controls the maximum amount of time the client will wait for the response of a request.
该配置控制客户端等待请求响应的最长时间。 If the response is not received before the timeout elapses the client will resend the request if necessary or fail the request if retries are exhausted.
如果在超时之前未收到响应,客户端将在必要时重新发送请求,或者如果重试次数耗尽则请求失败。 This should be larger than replica.lag.time.max.ms (a broker configuration) to reduce the possibility of message duplication due to unnecessary producer retries.
这应该大于 replica.lag.time.max.ms(代理配置)以减少由于不必要的生产者重试而导致消息重复的可能性。
Why a small request.timeout.ms may cause duplication?为什么一个小的 request.timeout.ms 可能会导致重复? Could someone elaborate more on that?
有人可以详细说明吗?
And does this still hold true if the producer retries config is set to 0?如果生产者重试配置设置为 0,这是否仍然适用?
if it's smaller than replica.lag.time.max.ms, then follower broker might persistent the msg successfully but producer req timed out, which will cause the duplication due to unnecessary producer retries如果它小于 replica.lag.time.max.ms,那么 follower broker 可能会成功持久化 msg 但 producer req 超时,这将由于不必要的 producer 重试而导致重复
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.