Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Future replica must be caught up before switch

...

  • If the partition is not assigned to a log directory (refers to Uuid.ZERO)
    • If the partition already exists, the broker uses the new RPC — AssignReplicasToDirs — to notify the controller to change the metadata assignment to the actual log directory.
    • If the partition does not exist, the broker selects a log directory and uses the new RPC — AssignReplicasToDirs — to notify the controller to create the metadata assignment to the actual log directory.
  • If the partition is assigned to an online log directory
    • If the partition does not exist it is created in the indicated log directory.
    • If the partition already exists in the indicated log directory no action is taken.
    • If the partition already exists in another online log directory and is a future replica in the log directory indicated by the metadata, the broker will replace the current replica with the future replica after making sure that the future replica as fully caught up with the current replica.
    • If the partition already exists in another online log directory, the broker uses the new RPC — AssignReplicasToDirs — to the controller to change the metadata assignment to the actual log directory. The partition might have been moved to a different log directory. whilst the broker was offline. 
    • If the broker knows that the partition already exists in a different log directory that is now offline, then the controller might not have known to update leadership and ISR when the log directory failure was communicated to the controller – unlikely, but possibly due to some synchronisation failure in the replica to log directory assignment between the broker and the metadata. To prevent the partition from remaining offline, the broker uses AssignReplicasToDirs to change the metadata assignment to an offline log directory. The controller learns the replica is offline and updates leadership and ISR.
  • If the partition is assigned to an offline log directory, no action is taken — the controller is already aware of this, and we don't want to fill the remaining online log directories with replicas that existed in the offline ones.
  • If the partition is assigned to an unknown log directory, no action is taken — the controller is already aware of this and will reassign the replica to one of the online log directories in a future metadata update. 

...