anchor.diff:      couch_index_merger:query_index(couch_view_merger, MergeParams, Req).
   
   
  -full_design_doc_view(Req, DbName, DesignName, ViewName, VBucketsDict) ->
  +full_design_doc_view(Req, Db, DesignName, ViewName, VBucketsDict) ->
       DDocId = <<"_design/", DesignName/binary>>,
  -    design_doc_view_loop(Req, DbName, DDocId, ViewName, VBucketsDict, ?RETRY_ATTEMPTS).
  -
  -design_doc_view_loop(_Req, _DbName, _DDocId, _ViewName, _, 0) ->
  +    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, DbName, DDocId, ViewName, VBucketsDict, Attempt) ->
  -    MergeParams = view_merge_params(Req, DbName, DDocId, ViewName, VBucketsDict),
  +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(DbName)),
  -            design_doc_view_loop(Req, DbName, DDocId, ViewName, NewVBucketsDict, Attempt - 1)
  +            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
  
positive.code:         _ ->
              case run_on_subset(Req, DbName) of
                  full_set ->
                      full_design_doc_view(Req, DbName, DDocName, ViewName, VBucketsDict);
                  VBucket ->
                      subset_design_doc_view(Req, DbName, DDocName, ViewName, [VBucket])
              end
      end.
  
  
negative.code: handle_view_req(#httpd{method='GET',
                         path_parts=[_, _, DName, _, ViewName]}=Req,
                  Db, _DDoc) ->
      do_handle_view_req(Req, Db, DName, ViewName);
  
  handle_view_req(#httpd{method='POST',
                         path_parts=[_, _, DName, _, ViewName]}=Req,
                  Db, _DDoc) ->
      couch_httpd:validate_ctype(Req, "application/json"),
      do_handle_view_req(Req, Db, DName, ViewName);
  
  handle_view_req(Req, _Db, _DDoc) ->
      couch_httpd:send_method_not_allowed(Req, "GET,POST,HEAD").
  
  do_handle_view_req(Req, #db{name=DbName} = Db, DDocName, ViewName) ->
      VBucketsDict = vbucket_map_mirror:node_vbuckets_dict(binary_to_list(DbName)),
      case dict:find(node(), VBucketsDict) of
          error ->
  