From 978f7dae6748e09830593f132e6977682e7d9453 Mon Sep 17 00:00:00 2001 From: Tony Sun Date: Tue, 25 Aug 2020 11:22:06 -0700 Subject: 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. --- src/couch_jobs/src/couch_jobs_fdb.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1