Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Replica {                                // a replica of a partition
  broker_id               : int
  partition               : Partition
  log                     : Log          // local log associated with this replica
  hw                      : long         // offset of the last committed message
  leo                     : long         // log end offset
  isLeader                : Boolean      // is this replica leader
}

Partition {                              //a partition in a topic
  topic                   : string
  partition_id            : int
  leader                  : Replica      // the leader replica of this partition
  ISR                     : Set[Replica] // In-sync replica set, maintained at the leader
  AR                      : Set[Replica] // All replicas assigned for this partition
  LeaderAndISRVersionInZK : long         // version id of the LeaderAndISR path; used for conditionally update the LeaderAndISR path in ZK
}



LeaderAndISRCommand {
  isInit                  : byte         // whether this is the first command issued by a controller
  leaderAndISRMap         : Map[(topic: String, partitionId: int) => LeaderAndISR) // a map of LeaderAndISR
}


LeaderAndISR {
  leader                  : int          // broker id of the leader
  leaderGenId             : int          // leader generation id, incremented on each leadership change
  ISR                     : Set[int]     // a set of the id of each broker in ISR
  zkVersion               : long         // version of the LeaderAndISR path in ZK 
}


LeaderAndISRResponse {
  responseMap             : Map[(topic: String, partitionId: int) => int) // a map of error code
}


StopReplicaCommand {
  stopReplicaSet          : Set[(topic: String, partitionId: int)) // a set of partitions to be stopped
}


StopReplicaResponse {
  responseMap             : Map[(topic: String, partitionId: int) => int) // a map of error code
}
A. Failover during broker failure.

...