nickva commented on code in PR #5760:
URL: https://github.com/apache/couchdb/pull/5760#discussion_r2558908787
##########
src/mem3/src/mem3_rep.erl:
##########
@@ -741,21 +802,19 @@ update_locals(Target, Db, Seq) ->
{ok, _} = couch_db:update_doc(Db, #doc{id = Id, body = NewBody}, []).
purge_cp_body(#shard{} = Source, #shard{} = Target, PurgeSeq) ->
- {Mega, Secs, _} = os:timestamp(),
- NowSecs = Mega * 1000000 + Secs,
{[
- {<<"type">>, <<"internal_replication">>},
- {<<"updated_on">>, NowSecs},
+ {<<"type">>, ?PURGE_TYPE},
+ {<<"updated_on">>, os:system_time(second)},
{<<"purge_seq">>, PurgeSeq},
{<<"source">>, atom_to_binary(Source#shard.node, latin1)},
{<<"target">>, atom_to_binary(Target#shard.node, latin1)},
- {<<"range">>, Source#shard.range}
+ {<<"range">>, Target#shard.range}
Review Comment:
Note: this is another fix. Since we're managing pushes to a target only it
makes sense to use the target range. In almost all cases it wouldn't matter as
the ranges would match. The only exception is during shard splitting -- then
we'd want to make sure we differentiate between the two targets that the source
would push to. Well, even then it wouldn't matter too much, as the uuids in the
doc_id would be different, but just for belt-and-suspenders verification using
the target range is still slightly more correct.
--
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]