summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2018-03-27 10:55:48 -0500
committerPaul J. Davis <paul.joseph.davis@gmail.com>2018-03-28 18:08:58 -0500
commit99a64b2508e815e5a820c802b0d9c802659e72d3 (patch)
tree882d1fd9f7bc8cc16aae29af479dc691fa323ea2
parentfe1ce4250a5850e60765a83612a4c10754dba114 (diff)
downloadcouchdb-99a64b2508e815e5a820c802b0d9c802659e72d3.tar.gz
Fix shard substitution in changes feeds
-rw-r--r--src/mem3/src/mem3_rep.erl4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mem3/src/mem3_rep.erl b/src/mem3/src/mem3_rep.erl
index 942f8a8e0..3d9187796 100644
--- a/src/mem3/src/mem3_rep.erl
+++ b/src/mem3/src/mem3_rep.erl
@@ -341,14 +341,12 @@ find_repl_doc(SrcDb, TgtUUIDPrefix) ->
SrcUUID = couch_db:get_uuid(SrcDb),
S = couch_util:encodeBase64Url(crypto:hash(md5, term_to_binary(SrcUUID))),
DocIdPrefix = <<"_local/shard-sync-", S/binary, "-">>,
- FoldFun = fun({DocId, {Rev0, {BodyProps}}}, _) ->
+ FoldFun = fun(#doc{id = DocId, body = {BodyProps}} = Doc, _) ->
TgtUUID = couch_util:get_value(<<"target_uuid">>, BodyProps, <<>>),
case is_prefix(DocIdPrefix, DocId) of
true ->
case is_prefix(TgtUUIDPrefix, TgtUUID) of
true ->
- Rev = list_to_binary(integer_to_list(Rev0)),
- Doc = #doc{id=DocId, revs={0, [Rev]}, body={BodyProps}},
{stop, {TgtUUID, Doc}};
false ->
{ok, not_found}