summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Sun <tony.sun427@gmail.com>2020-08-25 11:22:06 -0700
committerPaul J. Davis <paul.joseph.davis@gmail.com>2020-09-09 09:46:03 -0500
commiteb91b242bc10ca124e1a6a5e0a88b9ba81bb2489 (patch)
treece5a17aed9347a4c938214cfa89d498c9b76f453
parent2d86f9343c34b044d764565567f5cf16ece00a9c (diff)
downloadcouchdb-eb91b242bc10ca124e1a6a5e0a88b9ba81bb2489.tar.gz
clear jobs data in active area during removal
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;