anchor.diff:          true -> couch_util:shutdown_sync(State#st.pid);
           _ -> ok
       end,
  -    Pid = spawn_link(fun() -> update(Idx, State#st.mod, IdxState) end),
  +    Self = self(),
  +    Pid = spawn_link(fun() -> update(Self, Idx, State#st.mod, IdxState) end),
       {reply, ok, State#st{pid=Pid}};
   handle_call(is_running, _From, #st{pid=Pid}=State) when is_pid(Pid) ->
       {reply, true, State};
  
positive.code: handle_call({update, IdxState}, _From, #st{idx=Idx, mod=Mod}=State) ->
      Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)],
      ?LOG_INFO("Starting index update for db: ~s idx: ~s", Args),
      Pid = spawn_link(fun() -> update(Idx, Mod, IdxState) end),
      {reply, ok, State#st{pid=Pid}};
  handle_call({restart, IdxState}, _From, #st{idx=Idx, mod=Mod}=State) ->
      Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)],
  
negative.code:         end,
  
          {ok, FinalIdxState} = Mod:finish_update(LastIdxSt),
          gen_server:cast(Parent, {self(), updated, FinalIdxState})
      end).
  
  
  