Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarification on the onPartitionReassignment algo

...

To solve this problem it is necessary to compute a set of replicas to be removed from the assigned replicas when a reassignment changes.

The set set drop of replicas to be removed will be computed as follows:

  1. At the point a new reassignment is created we compute the value top = len(original_assignment) and store this in ZK. We also

    1. We check top >= min.insync.replicas, logging a warning and ignore the reassignment if the check fails.

    2. Otherwise we store this in the /admin/reassignments/$topic/$partition znode.
  2. Then, initially, and each time the reassignment changes, (i.e. in KafkaController.onPartitionReassignment()):
    1. Let assigned be the currently assigned replicas, ie. assigned = ControllerContext.partitionRepliacAssignment(tp)
    2. Define a sorted list of out-of-sync replicas: osr = assigned -- isr
    3. Create a list of current replicas existing = List(leader) ++ isr ++ osr
    4. Remove duplicates from existing (keeping the first occurrence in the list)

    5. Then, the set of replicas which can be dropped is: drop = assigned -- existing[0:top-1]

...