Versions Compared

Key

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

...

  1. At the point a new reassignment is created we compute the value top = len(original_assignment) and store this in ZK. We also check top >= min.insync.replicas, logging a warning and ignore the reassignment if the check fails.

  2. Then, initially, and each time the reassignment changes, (i.e. in KafkaController.onPartitionReassignment()):
    1. Define a sorted list of out-of-sync replicas: osr = sort( assigned -- isr, by_lag_ascending)
    2. Create a list of current replicas existing = List(leader) ++ isr ++ osr
    3. Remove duplicates from existing (keeping the first occurrence in the list)

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

...

  • Since top > 0 it is impossible to drop the leader, and thus it's impossible that a leader election will be needed at this point.
  • By the assumption top >= min.insync.replicas it's impossible to shrink the ISR to a point where producers are blocked, assuming the ISR was already sufficifient.

  • If the controller knew how far behind the ISR each of the OSR replicas was, OSR could be sorted, which would result in dropping the furthest-behind replicas. But the controller doesn't know this.

 In order to actually drop those replicas:

...