anchor.diff:          {Shard#shard{ref=Ref}, Docs}
       end, group_docs_by_shard(DbName, AllDocs)),
       {Workers, _} = lists:unzip(GroupedDocs),
  -    Acc0 = {length(Workers), length(AllDocs), couch_util:get_value(w, Options, 1),
  -        GroupedDocs, dict:from_list([{Doc,[]} || Doc <- AllDocs])},
  +    W = list_to_integer(couch_util:get_value(w, Options,
  +        couch_config:get("cluster", "w", "2"))),
  +    Acc0 = {length(Workers), length(AllDocs), W, GroupedDocs,
  +        dict:from_list([{Doc,[]} || Doc <- AllDocs])},
       case fabric_util:recv(Workers, #shard.ref, fun handle_message/3, Acc0) of
       {ok, Results} ->
           Reordered = couch_util:reorder_results(AllDocs, Results),
  
positive.code:     Docs = couch_util:get_value(Worker, GroupedDocs),
      handle_message({ok, [X || _D <- Docs]}, Worker, Acc0).
  
  force_reply(Doc, Replies, {W, Acc}) ->
      % TODO make a real decision here
      case Replies of
      [] ->
          {W, [{Doc, {error, internal_server_error}} | Acc]};
      [Reply| _] ->
          {W, [{Doc, Reply} | Acc]}
      end.
  
  maybe_reply(_, _, continue) ->
  
negative.code:     end.
  
  update_quorum_met(W, Replies) ->
      Counters = lists:foldl(fun(R,D) -> orddict:update_counter(R,1,D) end,
          orddict:new(), Replies),
      case lists:dropwhile(fun({_, Count}) -> Count < W end, Counters) of
      [] ->
          false;
      [{FinalReply, _} | _] ->
          {true, FinalReply}
      end.
  
  -spec group_docs_by_shard(binary(), [#doc{}]) -> [{#shard{}, [#doc{}]}].
  