anchor.diff:       {progress, Progress}].
   
   
  -finalize_xcdr_plist({ChangesLeft, DocsChecked, DocsWritten, DataReplicated,
  -                     ActiveVbReps, WaitingVbReps, TimeWorking, TimeCommitting,
  -                     NumCheckpoints, DocsRepQueue, SizeRepQueue, Errors}) ->
  +finalize_xcdr_plist({ChangesLeft, DocsChecked, DocsWritten, Errors}) ->
       FlattenedErrors = lists:flatten(Errors),
       SortedErrors = lists:reverse(lists:sort(FlattenedErrors)),
       Len = length(SortedErrors),
  
positive.code:      {changesLeft, ChangesLeft},
       {docsChecked, DocsChecked},
       {docsWritten, DocsWritten},
       {dataReplicated, DataReplicated},
       {activeVbreps, ActiveVbReps},
       {waitingVbreps, WaitingVbReps},
       {timeWorking, TimeWorking},
       {timeCommitting, TimeCommitting},
       {numCheckpoints, NumCheckpoints},
       {docsRepQueue, DocsRepQueue},
       {sizeRepQueue, SizeRepQueue},
       {errors, OutputErrors}].
  
  
  
negative.code:                {ChangesDone2, TotalChanges2}) ->
      {ChangesDone1 + ChangesDone2, TotalChanges1 + TotalChanges2};
  task_operation(fold, {xdcr, _},
                {ChangesLeft1, DocsChecked1, DocsWritten1, Errors1},
                {ChangesLeft2, DocsChecked2, DocsWritten2, Errors2}) ->
      {ChangesLeft1 + ChangesLeft2,
       DocsChecked1 + DocsChecked2,
       DocsWritten1 + DocsWritten2,
       [Errors1 | Errors2]}.
  
  
  