Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka, mail # dev - [jira] [Comment Edited] (KAFKA-813) Minor cleanup in Controller


Copy link to this message
-
[jira] [Comment Edited] (KAFKA-813) Minor cleanup in Controller
"Neha Narkhede 2013-03-20, 15:23

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

Neha Narkhede edited comment on KAFKA-813 at 3/20/13 3:22 PM:
--------------------------------------------------------------

Thanks for patch v2 -

1. KafkaController
1.1 The change to OfflinePartitionsCount looks good. However, there is a distinction between a partition whose leader is not alive but other replicas are so leader election will happen and a partition for which all replicas are dead. In the latter case, there can be no leader for that partition which is a much more dangerous state for a partition to be in. I suggest two metrics, OfflinePartitionsCount to indicate the former and UnavailablePartitionsCount to indicate the latter
1.2 I wonder why ActiveControllerCount and OfflinePartitionsCount are not part of ControllerStats ?

2. NoOpLeaderSelector
Minor code style suggestion - return is not required here.

3. PartitionStateMachine
We don't have to define the noOpLeaderSelector in the controller since it is used only in PartitionStateMachine.handleStateChanges(). Let's move it there. The reason offlineLeaderSelector is there since both the controller and the partition state machine access it.

Nit pick - Can we change PartitionNoReplicaOnlineException to NoReplicaOnlineForPartitionException or simply NoReplicaOnlineException ? :)
                
      was (Author: nehanarkhede):
    Thanks for patch v2 -

1. KafkaController
1.1 The change to OfflinePartitionsCount looks good. However, there is a distinction between a partition whose leader is not alive but other replicas are so leader election will happen and a partition for which all replicas are dead. In the latter case, there can be no leader for that partition which is a much more dangerous state for a partition to be in. I suggest two metrics, OfflinePartitionsCount to indicate the former and UnavailablePartitionsCount to indicate the latter
1.2 I wonder why ActiveControllerCount and OfflinePartitionsCount are not part of ControllerStats ?

2. NoOpLeaderSelector
Minor code style suggestion - return is not required here.

3. PartitionStateMachine
We don't have to define the noOpLeaderSelector in the controller since it is used only in PartitionStateMachine.handleStateChanges(). Let's move it there. The reason offlineLeaderSelector is there since both the controller and the partition state machine access it.

Nit pick - Can we change PartitionNoReplicaOnlineException to NoReplicaForPartitionException ? :)
                  
> Minor cleanup in Controller
> ---------------------------
>
>                 Key: KAFKA-813
>                 URL: https://issues.apache.org/jira/browse/KAFKA-813
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8
>            Reporter: Swapnil Ghike
>            Assignee: Swapnil Ghike
>            Priority: Blocker
>              Labels: kafka-0.8
>             Fix For: 0.8
>
>         Attachments: kafka-813-v1.patch, kafka-813-v2.patch
>
>
> Before starting work on delete topic support, uploading a patch first to address some minor hiccups that touch a bunch of files:
> 1. Change PartitionOfflineException to PartitionUnavailableException because in the partition state machine we mark a partition offline when its leader is down, whereas the PartitionOfflineException is thrown when all the assigned replicas of the partition are down.
> 2. Change PartitionOfflineRate to UnavailablePartitionRate
> 3. Remove default leader selector from partition state machine's handleStateChange. We can specify null as default when we don't need to use a leader selector.
> 4. Include controller info in the client id of LeaderAndIsrRequest.
> 5. Rename controllerContext.allleaders to something more meaningful - partitionLeadershipInfo.
> 6. We don't need to put partition in OnlinePartition state in partition state machine initializeLeaderAndIsrForPartition, the state change occurs in handleStateChange.

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