summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2019-01-14 16:33:13 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2019-01-14 16:33:13 -0600
commit06ce9d4ff391e128efba398aa2d11ef2b6fd2314 (patch)
treee069c93ce9d0b4111695b4644418e83f86e0003d
parent587d674582762610fe7cf0fcdfcb563d9b0abcab (diff)
downloadcouchdb-fix-read-repair.tar.gz
Fix read repair in a mixed cluster environmentfix-read-repair
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.
-rw-r--r--src/fabric/src/fabric_doc_open.erl4
-rw-r--r--src/fabric/src/fabric_doc_open_revs.erl2
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 0a85346f7..aafdcfb79 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 234b108ef..15b8eacb9 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, []} ->