jiahuili430 commented on code in PR #6210:
URL: https://github.com/apache/couchdb/pull/6210#discussion_r4520811215


##########
src/mem3/src/mem3_rep.erl:
##########
@@ -543,7 +552,10 @@ pull_purges(Db, Count, #shard{} = SrcShard, #tgt{} = Tgt0, 
HashFun) ->
             end,
             Infos1 = lists:filter(BelongsFun, Infos),
             {ok, _} = couch_db:purge_docs(Db, Infos1, [?REPLICATED_CHANGES]),
-            Body = purge_cp_body(SrcShard, TgtShard, ThroughSeq),
+            % A checkpoint form the target but it's the same one the target
+            % uses when it pushes to us. So we write it from the target's point
+            % of view: it's the source and we are the target.
+            Body = purge_cp_body(TgtShard, SrcShard, ThroughSeq),

Review Comment:
   Much easier to understand now, thank you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to