Fix stuck internal replications after node down

We weren't removing entries from the dict tracking what was in the job
queue. This looks like a bug after the switch from tuples to the #job{}
record which means its probably been around for quite awhile. Simple fix
is simply to use the correct dict key.

BugzId: 14654


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/e108c749
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/e108c749
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/e108c749

Branch: refs/heads/import
Commit: e108c74975fb0353c9f8a3e1f886d586356b57ea
Parents: e5ef479
Author: Paul J. Davis <[email protected]>
Authored: Fri Sep 7 01:57:03 2012 -0500
Committer: Paul J. Davis <[email protected]>
Committed: Fri Sep 7 01:57:03 2012 -0500

----------------------------------------------------------------------
 src/mem3_sync.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/e108c749/src/mem3_sync.erl
----------------------------------------------------------------------
diff --git a/src/mem3_sync.erl b/src/mem3_sync.erl
index 9f3b752..3b20d49 100644
--- a/src/mem3_sync.erl
+++ b/src/mem3_sync.erl
@@ -317,7 +317,9 @@ is_running(DbName, Node, ActiveList) ->
     [] =/= [true || #job{name=S, node=N} <- ActiveList, S=:=DbName, N=:=Node].
 
 remove_entries(Dict, Entries) ->
-    lists:foldl(fun(Entry, D) -> dict:erase(Entry, D) end, Dict, Entries).
+    lists:foldl(fun(#job{name=S, node=N}, D) ->
+        dict:erase({S, N}, D)
+    end, Dict, Entries).
 
 local_dbs() ->
     [nodes_db(), shards_db(), users_db()].

Reply via email to