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 2018/03/28 21:01:20 UTC
[couchdb] 01/01: Fix shard substitution in changes feeds
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a commit to branch fix-shard-substitution
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit cb34c58b07aaea9a362c8bcc82962ec9ea321134
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Mar 27 10:55:48 2018 -0500
Fix shard substitution in changes feeds
---
src/mem3/src/mem3_rep.erl | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/mem3/src/mem3_rep.erl b/src/mem3/src/mem3_rep.erl
index 942f8a8..3d91877 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}
--
To stop receiving notification emails like this one, please contact
davisp@apache.org.