pub(crate) async fn select_migration_target(
ctx: &Context,
region_id: RegionId,
follower_peers: &[Peer],
) -> Result<Peer>Expand description
Selects the migration destination of region_id off the drained datanode.
Returns the pinned target when the procedure has one, otherwise the schedulable datanode with the smallest peer id. Candidates come from the peer discovery, so the returned peer carries its address and was not marked unschedulable; the drained datanode and the existing followers are excluded.