summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Sun <tony.sun427@gmail.com>2020-08-25 11:22:06 -0700
committerTony Sun <tony.sun427@gmail.com>2020-08-25 11:28:45 -0700
commit978f7dae6748e09830593f132e6977682e7d9453 (patch)
tree47109011ef4418ac27af872f1436e52ed0b806e3
parent790dafffba0af12e1c87dab6159d0864f55b16f1 (diff)
downloadcouchdb-fix-couch-jobs-for-active-tasks.tar.gz
clear jobs data in active area during removalfix-couch-jobs-for-active-tasks
During job removal, it was not cleared from the active area so active_tasks would mistakenly believe the job still existed. When we try to actually open the data it is not there and not_found error would be issued.@nickva found this issue during replication work.
-rw-r--r--src/couch_jobs/src/couch_jobs_fdb.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/couch_jobs/src/couch_jobs_fdb.erl b/src/couch_jobs/src/couch_jobs_fdb.erl
index 891aedc79..3fcad554a 100644
--- a/src/couch_jobs/src/couch_jobs_fdb.erl
+++ b/src/couch_jobs/src/couch_jobs_fdb.erl
@@ -119,8 +119,9 @@ remove(#{jtx := true} = JTx0, #{job := true} = Job) ->
#{type := Type, id := JobId} = Job,
Key = job_key(JTx, Job),
case get_job_val(Tx, Key) of
- #jv{stime = STime} ->
+ #jv{stime = STime, seq = Seq} ->
couch_jobs_pending:remove(JTx, Type, JobId, STime),
+ clear_activity(JTx, Type, Seq),
erlfdb:clear(Tx, Key),
update_watch(JTx, Type),
ok;