anchor.diff:      {type, Type} = lists:keyfind(type, 1, Task),
       Type.
   
  +task_priority(recovery) ->
  +    0;
  +task_priority(rebalance) ->
  +    1;
   task_priority(xdcr) ->
  -    0;
  +    2;
   task_priority(indexer) ->
  -    1;
  +    3;
   task_priority(bucket_compaction) ->
  -    2;
  +    4;
   task_priority(view_compaction) ->
  -    3;
  +    5;
   task_priority(_) ->
  -    4.
  +    6.
   
   task_name(Task, xdcr) ->
       proplists:get_value(id, Task);
  
positive.code:                   PrioA = task_priority(TypeA),
                    PrioB = task_priority(TypeB),
                    {PrioA, task_name(A, TypeA)} =< {PrioB, task_name(B, TypeB)}
            end, PreRebalanceTasks1),
  
      PreRebalanceTasks = [{struct, V} || V <- PreRebalanceTasks2],
  
      RebalanceTask0 = build_rebalance_task(RebStatusTimeout),
      RebalanceTask = {struct, RebalanceTask0},
  
      MaybeRecoveryTask = build_recovery_task(PoolId),
  
      MaybeRecoveryTask ++ [RebalanceTask | PreRebalanceTasks].
  
  build_xdcr_tasks(TasksDict, AllRepDocs) ->
      [begin
  
negative.code:     [[{status, running} | KV] || KV <- WarmupTasks0].
  
  build_rebalance_task(Timeout) ->
      Task = do_build_rebalance_task(Timeout),
      [Task].
  
  do_build_rebalance_task(Timeout) ->
      case (catch ns_orchestrator:rebalance_progress_full(Timeout)) of
          {running, PerNode} ->
              DetailedProgress = get_detailed_progress(),
  