diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2020-10-08 15:22:51 -0400 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2020-10-08 15:45:27 -0400 |
commit | 2b215079ed7130ab741ad3e29d3b674dd9395b52 (patch) | |
tree | bc79411e5b6668b868c0572eda3ea5ae6e17d86c | |
parent | 6717faf8515fbb7f029fbd654adec993fd456ac2 (diff) | |
download | couchdb-2b215079ed7130ab741ad3e29d3b674dd9395b52.tar.gz |
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.
-rw-r--r-- | src/couch_replicator/src/couch_replicator_job.erl | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/couch_replicator/src/couch_replicator_job.erl b/src/couch_replicator/src/couch_replicator_job.erl index e13fb1120..c8c143a58 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, |