anchor.diff:  -define(RETRY_INTERVAL, 5 * 1000).
   -define(RETRY_ATTEMPTS, 20).
   
  -subset_design_doc_view(Req, BucketName, DesignName, ViewName, [VBucket]) ->
  +subset_design_doc_view(Req, #db{name=BucketName}, DesignName, ViewName,
  +                       [VBucket]) ->
       DDocId = <<"_design/", DesignName/binary>>,
       [Spec] = build_local_set_specs(BucketName, DDocId, ViewName, [VBucket]),
       Specs = [Spec#set_view_spec{category = dev}],
  
positive.code:                   end, [], NodeToVBuckets),
      finalize_view_merge_params(Req, ViewSpecs);
  
  view_merge_params(Req, BucketName, DDocId, ViewName, NodeToVBuckets) ->
      ViewSpecs = dict:fold(
                    fun(Node, VBuckets, Acc) when Node =:= node() ->
                            build_local_set_specs(BucketName,
  
negative.code:     couch_index_merger:query_index(couch_view_merger, MergeParams, Req).
  
  
  full_design_doc_view(Req, Db, DesignName, ViewName, VBucketsDict) ->
      DDocId = <<"_design/", DesignName/binary>>,
      design_doc_view_loop(Req, Db, DDocId, ViewName, VBucketsDict, ?RETRY_ATTEMPTS).
  
  design_doc_view_loop(_Req, _Db, _DDocId, _ViewName, _, 0) ->
      throw({error, inconsistent_state});
  design_doc_view_loop(Req, Db, DDocId, ViewName, VBucketsDict, Attempt) ->
      MergeParams = view_merge_params(Req, Db, DDocId, ViewName, VBucketsDict),
      try
          couch_index_merger:query_index(couch_view_merger, MergeParams, Req)
      catch
          throw:{error, set_view_outdated} ->
              ?views_debug("Got `set_view_outdated` error. Retrying."),
              timer:sleep(?RETRY_INTERVAL),
              NewVBucketsDict = vbucket_map_mirror:node_vbuckets_dict(?b2l(Db#db.name)),
              design_doc_view_loop(Req, Db, DDocId, ViewName, NewVBucketsDict, Attempt - 1)
      end.
  
  %% @doc Returns a vBucket if it is run on a subset (single vBucket) only, else
  