anchor.diff:      % the trees, the attachments are already written to disk)
       {ok, FlushedFullDocInfos} = flush_trees(Db2, NewFullDocInfos, []),
   
  -    {IndexFullDocInfos, IndexDocInfos} =
  -            new_index_entries(FlushedFullDocInfos, [], []),
  +    {IndexFullDocInfos, IndexDocInfos, UpdatedDDocIds} =
  +            new_index_entries(FlushedFullDocInfos, [], [], []),
   
       % and the indexes
       {ok, DocInfoByIdBTree2} = couch_btree:add_remove(DocInfoByIdBTree, IndexFullDocInfos, []),
  
positive.code: 
      % Check if we just updated any design documents, and update the validation
      % funs if we did.
      case lists:any(
          fun(<<"_design/", _/binary>>) -> true; (_) -> false end, Ids) of
      false ->
          Db4 = Db3;
      true ->
          Db4 = refresh_validate_doc_funs(Db3)
      end,
  
      {ok, commit_data(Db4, not FullCommit)}.
  
  
  update_local_docs(Db, []) ->
      {ok, Db};
  
negative.code:     NonRepDocs2 = [{Client, NRDoc} || NRDoc <- NonRepDocs],
      try update_docs_int(Db, GroupedDocs3, NonRepDocs2, MergeConflicts,
                  FullCommit2) of
      {ok, Db2, UpdatedDDocIds} ->
          ok = gen_server:call(Db#db.main_pid, {db_updated, Db2}),
          if Db2#db.update_seq /= Db#db.update_seq ->
              couch_db_update_notifier:notify({updated, Db2#db.name});
          true -> ok
          end,
          [catch(ClientPid ! {done, self()}) || ClientPid <- Clients],
          lists:foreach(fun(DDocId) ->
              couch_db_update_notifier:notify({ddoc_updated, {Db#db.name, DDocId}})
          end, UpdatedDDocIds),
          {noreply, Db2}
      catch
          throw: retry ->
  