You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2019/01/14 23:41:13 UTC

[couchdb] branch master updated: Fix read repair in a mixed cluster environment

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new c6b095b  Fix read repair in a mixed cluster environment
c6b095b is described below

commit c6b095b2ad716b917d260c8a0a56f3d4676ced7f
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Mon Jan 14 16:33:13 2019 -0600

    Fix read repair in a mixed cluster environment
    
    This enables backwards compatbility with nodes still running the old
    version of fabric_rpc when a cluster is upgraded to master. This has no
    effect once all nodes are upgraded to the latest version.
---
 src/fabric/src/fabric_doc_open.erl      | 4 ++--
 src/fabric/src/fabric_doc_open_revs.erl | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/fabric/src/fabric_doc_open.erl b/src/fabric/src/fabric_doc_open.erl
index 0a85346..aafdcfb 100644
--- a/src/fabric/src/fabric_doc_open.erl
+++ b/src/fabric/src/fabric_doc_open.erl
@@ -136,7 +136,7 @@ read_repair(#acc{dbname=DbName, replies=Replies, node_revs=NodeRevs}) ->
     [#doc{id = <<?LOCAL_DOC_PREFIX, _/binary>>} | _] ->
         choose_reply(Docs);
     [#doc{id=Id} | _] ->
-        Opts = [?ADMIN_CTX, {read_repair, NodeRevs}],
+        Opts = [?ADMIN_CTX, replicated_changes, {read_repair, NodeRevs}],
         Res = fabric:update_docs(DbName, Docs, Opts),
         case Res of
             {ok, []} ->
@@ -592,4 +592,4 @@ t_get_doc_info() ->
         ?assert(is_record(Rec2, full_doc_info))
     end).
 
--endif.
\ No newline at end of file
+-endif.
diff --git a/src/fabric/src/fabric_doc_open_revs.erl b/src/fabric/src/fabric_doc_open_revs.erl
index 234b108..15b8eac 100644
--- a/src/fabric/src/fabric_doc_open_revs.erl
+++ b/src/fabric/src/fabric_doc_open_revs.erl
@@ -224,7 +224,7 @@ dict_repair_docs(Replies, ReplyCount) ->
 
 
 read_repair(Db, Docs, NodeRevs) ->
-    Opts = [?ADMIN_CTX, {read_repair, NodeRevs}],
+    Opts = [?ADMIN_CTX, replicated_changes, {read_repair, NodeRevs}],
     Res = fabric:update_docs(Db, Docs, Opts),
     case Res of
         {ok, []} ->