> On Sept. 26, 2014, 12:17 a.m., Jun Rao wrote:
> > Thanks for the patch. Looks good overall. A couple of comments.
> > 
> > 1. Let's add a check of min.isr in Partition.appendMessagesToLeader() so 
> > that the message is not added to the leader's log if isr is less than 
> > min.isr.
> > 2. We talked about dropping the ack > 1 support in the jira. However, I 
> > think that's easier done after kafka-1583 is completed. So, we don't have 
> > to do this change here. I will file a follow up jira.
> 
> Jun Rao wrote:
>     1. We can give a different exception in this case, sth like 
> RejectMessageDueToNotEnoughReplicas.
> 
> Gwen Shapira wrote:
>     Jun,
>     Regarding #1 (check for min.isr in appendMessageToLeader):
>     
>     From what I see, appendMessageToLeader happens before we do 
> checkEnoughReplicasReachOffset. 
>     If appendMessageToLeader throws a NotEnoughReplicas exception, the 
> message will never make it to purgatory and checkEnoughReplicas will never 
> get called at all.
>     
>     However, I don't see anything preventing the ISR from shrinking after we 
> wrote to the leader. In which case checkEnoughReplicas will throw a 
> NotEnoughReplicas exception for a message that was already written to the 
> leader.
>     
>     Maybe we need to different exceptions so producers can tell the 
> difference between the cases?

Gwen,

Yes, it would be good to have two different exceptions for these cases. Also, 
let's remove the ack > 2 support from the doc in ProducerConfig (both the old 
and the new producer) and add a check to make sure that the provided value is 
valid.


- Jun


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25886/#review54635
-----------------------------------------------------------


On Sept. 25, 2014, 7:41 p.m., Gwen Shapira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25886/
> -----------------------------------------------------------
> 
> (Updated Sept. 25, 2014, 7:41 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> KAFKA-1555: provide strong consistency with reasonable availability
> 
> 
> Diffs
> -----
> 
>   
> clients/src/main/java/org/apache/kafka/common/errors/NotEnoughReplicasException.java
>  PRE-CREATION 
>   clients/src/main/java/org/apache/kafka/common/protocol/Errors.java d434f42 
>   core/src/main/scala/kafka/cluster/Partition.scala ff106b4 
>   core/src/main/scala/kafka/common/ErrorMapping.scala 3fae791 
>   core/src/main/scala/kafka/common/NotEnoughReplicasException.scala 
> PRE-CREATION 
>   core/src/main/scala/kafka/log/LogConfig.scala 5746ad4 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 39f777b 
>   core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala 24deea0 
>   core/src/test/scala/unit/kafka/utils/TestUtils.scala 2dbdd3c 
> 
> Diff: https://reviews.apache.org/r/25886/diff/
> 
> 
> Testing
> -------
> 
> With 3 broker cluster, created 3 topics each with 1 partition and 3 replicas, 
> with 1,3 and 4 min.insync.replicas.
> * min.insync.replicas=1 behaved normally (all writes succeeded as long as a 
> broker was up)
> * min.insync.replicas=3 returned NotEnoughReplicas when required.acks=-1 and 
> one broker was down
> * min.insync.replicas=4 returned NotEnoughReplicas when required.acks=-1
> 
> See notes about retry behavior in the JIRA.
> 
> 
> Thanks,
> 
> Gwen Shapira
> 
>

Reply via email to