From 46d7b8cd7d9088cc6a5257d23679b51e962c7e30 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 20 Oct 2010 14:55:24 -0400 Subject: repair should run with R=N --- apps/fabric/src/fabric_doc_open.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/fabric/src') 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}; -- cgit v1.2.3