gpt4 book ai didi

apache-kafka - 如果 ISR 小于复制因子并且生产者确认设置为全部,生产者将等待多少个确认?

转载 作者:行者123 更新时间:2023-12-03 08:47:32 24 4
gpt4 key购买 nike

  • RF = 3,ISR = 3,acks = all >>> 发送成功
  • RF = 3,ISR = 2,acks = all >>> 发送成功
  • RF = 3,ISR = 1,acks = all >>> 发送成功
  • RF = 3 , ISR = 1 , acks = all , min.isr.replicas = 3 >>> 发送成功!

那么,如果复制因子为 4,ISR 为 3,生产者确认设置为全部,生产者将等待多少个确认?我尝试了不同的场景,真正的行为应该是什么?

最佳答案

当涉及到acks时,设置主题本身的复制因子仅起到隐式作用。正如代理配置 documentation 中所写下面引用的 min.insync.replicas 定义了在被视为成功写入之前代理范围内成功复制的最小数量。

min.insync.replicas: When a producer sets acks to "all" (or "-1"), min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend). When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.

Type: int

Default: 1

Valid Values: [1,...]

Importance: high

Update Mode: cluster-wide

回答您的具体问题:如果复制因子为4,min.insync.replicas为3,并且生产者acks设置为all,那么生产者将等待集群内的3次确认才被视为成功写入。

关于apache-kafka - 如果 ISR 小于复制因子并且生产者确认设置为全部,生产者将等待多少个确认?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60828448/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com