anchor.diff:       State#state{open_dbs=lists:delete(DBRef, DBs)}}.
   
   %% @doc Performs the actual repair work, called from a spawned process.
  --spec repair_partition(integer(), integer(), {pid(), any()}, pid()) ->
  +-spec repair_partition(integer(), integer()|undefined, atom()|pid(), pid()) ->
       #partition_result{}.
   repair_partition(Partition, DutyCycle, From, TreePid) ->
       case get_hashtree_lock(TreePid, ?LOCK_RETRIES) of
  
positive.code:                                               error=BuildTreeErr,
                                                index_scan_count=IndexDBCount}
                      end,
                      destroy_index_data_db(DBDir, DBRef),
                      lager:info("Finished repairing indexes in partition ~p",
                                 [Partition]),
                      Res;
  
negative.code:     wait_for_aae_pid({ReqId, {error, undefined_aae_pid}}, State);
  wait_for_aae_pid({ReqId, {error, Err}}, State=#state{aae_pid_req_id=ReqId,
                                                       aae_pid_timer=Timer}) ->
      _ = gen_fsm:cancel_timer(Timer),
      State2 = State#state{aae_pid_timer=undefined},
      State3 = add_result(#partition_result{status=error, error={no_aae_pid, Err}}, State2),
      State4 = maybe_notify(State3, {error, {no_aae_pid, Err}}),
  