summaryrefslogtreecommitdiff
path: root/apps/fabric/src/fabric_doc_open.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/fabric/src/fabric_doc_open.erl')
-rw-r--r--apps/fabric/src/fabric_doc_open.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/fabric/src/fabric_doc_open.erl b/apps/fabric/src/fabric_doc_open.erl
index 9131c94b..dd4917b9 100644
--- a/apps/fabric/src/fabric_doc_open.erl
+++ b/apps/fabric/src/fabric_doc_open.erl
@@ -25,16 +25,17 @@ go(DbName, Id, Options) ->
[Id, [deleted|Options]]),
SuppressDeletedDoc = not lists:member(deleted, Options),
R = couch_util:get_value(r, Options, couch_config:get("cluster","r","2")),
+ RepairOpts = [{r, integer_to_list(mem3:n(DbName))} | Options],
Acc0 = {length(Workers), list_to_integer(R), []},
case fabric_util:recv(Workers, #shard.ref, fun handle_message/3, Acc0) of
{ok, Reply} ->
format_reply(Reply, SuppressDeletedDoc);
{error, needs_repair, Reply} ->
- spawn(fabric, open_revs, [DbName, Id, all, Options]),
+ spawn(fabric, open_revs, [DbName, Id, all, RepairOpts]),
format_reply(Reply, SuppressDeletedDoc);
{error, needs_repair} ->
% we couldn't determine the correct reply, so we'll run a sync repair
- {ok, Results} = fabric:open_revs(DbName, Id, all, Options),
+ {ok, Results} = fabric:open_revs(DbName, Id, all, RepairOpts),
case lists:partition(fun({ok, #doc{deleted=Del}}) -> Del end, Results) of
{[], []} ->
{not_found, missing};