Omit local docs from read repair operation

Read repair uses replicated_changes when calling update docs, which does not
distinguish between local and non-local docs.

BugzID: 17527


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/b822bf6d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/b822bf6d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/b822bf6d

Branch: refs/heads/import
Commit: b822bf6d85d8debb4bf4592db89b79c080764456
Parents: 9f09897
Author: Bob Dionne <[email protected]>
Authored: Mon Feb 25 07:16:35 2013 -0500
Committer: Bob Dionne <[email protected]>
Committed: Mon Feb 25 07:16:35 2013 -0500

----------------------------------------------------------------------
 src/fabric_doc_open.erl | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/b822bf6d/src/fabric_doc_open.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_open.erl b/src/fabric_doc_open.erl
index 3a7726f..d6db1e1 100644
--- a/src/fabric_doc_open.erl
+++ b/src/fabric_doc_open.erl
@@ -115,6 +115,9 @@ is_r_met(Workers, Replies, R) ->
 read_repair(#acc{dbname=DbName, replies=Replies}) ->
     Docs = [Doc || {_, {{ok, #doc{}=Doc}, _}} <- Replies],
     case Docs of
+    % omit local docs from read repair
+    [#doc{id = <<?LOCAL_DOC_PREFIX, _/binary>>} | _] ->
+        choose_reply(Docs);
     [#doc{id=Id} | _] ->
         Ctx = #user_ctx{roles=[<<"_admin">>]},
         Opts = [replicated_changes, {user_ctx, Ctx}],

Reply via email to