[ 
https://issues.apache.org/jira/browse/KAFKA-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483755#comment-13483755
 ] 

Joel Koshy commented on KAFKA-340:
----------------------------------

21.2: sure will make those changes.

21.4: We don't send stopReplicaRequests for partitions whose leader is *still* 
on the broker to be shut down - we could, but it probably doesn't matter and 
the existing behavior is a side-effect of the if condition that needs to be 
there. Say, there are two partitions ("a", "b") led by the broker, and "c" is 
some other partition that the broker is following. Suppose leadership of "a" is 
successfully moved to another broker, but leadership of "b" is not. In this 
case, the broker will get StopReplica requests for "a" and "c" but not "b" 
because of the "if (controllerContext.allLeaders(topicAndPartition) != id) {" 
to prevent removing it from the ISR which does not make sense because:
(i) The partition/replica is still online (since leadership was not moved).
(ii) In my comment for v2. I mentioned the possibility of a shutting down 
broker remaining in ISR. So suppose broker 0 was shutdown, the leader is now 1, 
and ISR is still 0,1. Now shutdown broker 1, then leader election will fail 
(because 0 is shutting down) - in which case I should not remove 1 from the 
ISR. (Without that guard we would end up with leader: 1, isr: 0 which does not 
make sense.

                
> Implement clean shutdown in 0.8
> -------------------------------
>
>                 Key: KAFKA-340
>                 URL: https://issues.apache.org/jira/browse/KAFKA-340
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Joel Koshy
>            Priority: Blocker
>              Labels: bugs
>         Attachments: KAFKA-340-v1.patch, KAFKA-340-v2.patch, 
> KAFKA-340-v3.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> If we are shutting down a broker when the ISR of a partition includes only 
> that broker, we could lose some messages that have been previously committed. 
> For clean shutdown, we need to guarantee that there is at least 1 other 
> broker in ISR after the broker is shut down.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to