You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Yang Ye (JIRA)" <ji...@apache.org> on 2012/06/29 12:21:44 UTC

[jira] [Updated] (KAFKA-343) revisit the become leader and become follower state change operations using V3 design

     [ https://issues.apache.org/jira/browse/KAFKA-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yang Ye updated KAFKA-343:
--------------------------

    Attachment: kafka_343.patch

following description is incomplete but I will fill them with more comprehensive descriptions. Also the patch may still be prone to some bug. I shall work on fixing in.

notes:
1. ZkUtils.scala
1.1 change the return type of readData() and readDataMaybeNull() from "String" to (Stat, String)
1.2 add a "conditionalUpdatePersistentPath()" function
1.3 Change the return type from "String" to "Int" for partitions and replicas in a few utility functions
1.4 Add some utility functions like "getReplicasForPartition", "getReplicaAssignmentForTopics", "getPartitionLeaderAndISRFroTopics", 
"getPartitionAssignmentForTopics", etc. 
1.5 change the return type of "updatePersistentPath" from "null" to "Int' which corresponds to the new zkPath version

2. KafkaServer.scala
2.1 Order of startup: 
socketServer first, kafkaZookeeper second, replicaManager 3rd, KafkaController 4th, KafkaApis 5th
2.2 Change the type of "stopReplica", "makeLeader", "makeFollower" to "Short" which corresponds to error code

3. ReplicaManager.scala
3.1 add a StopReplica() function
3.2 Expose the "allReplicas" filed to outside (was private before) for usage in "KafkaApis"

4. kafkaController.scala
4.1 Basically implement the failover logic according to the design

5 kafkaZookeeper.scala:
5.1 Migrate the leader election logic
5.2 add a "initLocalReplica" function for startup.

6. KafkaApis.scala:
Implement the "handleLeaderAndISRRequest" and "handleStopReplicaRequest" function

7. LeaderAndISRRequest.scala:
Change the zkPathVersion from "Long" type to "Int" 
                
> revisit the become leader and become follower state change operations using V3 design
> -------------------------------------------------------------------------------------
>
>                 Key: KAFKA-343
>                 URL: https://issues.apache.org/jira/browse/KAFKA-343
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Yang Ye
>             Fix For: 0.8
>
>         Attachments: kafka_343.patch
>
>
> We need to reimplement become leader/follower using the controller model described in https://cwiki.apache.org/confluence/display/KAFKA/kafka+Detailed+Replication+Design+V3

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira