You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/10/08 19:49:44 UTC

[couchdb] branch main updated: Do not shortcut replicator job initialization if replication ID matches

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 2b21507  Do not shortcut replicator job initialization if replication ID matches
2b21507 is described below

commit 2b215079ed7130ab741ad3e29d3b674dd9395b52
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Oct 8 15:22:51 2020 -0400

    Do not shortcut replicator job initialization if replication ID matches
    
    Previously there was an attempt to shortcut some of the job initialization if
    replication ID in the job data and the newly computed one matched. However,
    that logic was wrong as it skipped over the job data state update.
    
    The effect was that if a job was in a pending state, and it re-initialized, say
    when a node restarted, its job data would still indicate it as "pending" until
    the next checkpoint. If the job is continuous, and there are no more updates on
    the source, the state of the job would stay in "pending" indefinitely.
---
 src/couch_replicator/src/couch_replicator_job.erl | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/couch_replicator/src/couch_replicator_job.erl b/src/couch_replicator/src/couch_replicator_job.erl
index e13fb11..c8c143a 100644
--- a/src/couch_replicator/src/couch_replicator_job.erl
+++ b/src/couch_replicator/src/couch_replicator_job.erl
@@ -505,10 +505,6 @@ do_init(Job, #{} = JobData) ->
     update_job_state(State1).
 
 
-init_job_data(#{jtx := true} = JTx, Job, #{?REP_ID := RepId} = JobData, RepId,
-        _BaseId) ->
-    {Job, JobData, check_ownership(JTx, Job, JobData)};
-
 init_job_data(#{jtx := true} = JTx, Job, #{} = JobData, RepId, BaseId) ->
     #{
         ?REP := Rep,