couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [37/50] fabric commit: updated refs/heads/windsor-merge-121 to 79e6e2f
Date Fri, 01 Aug 2014 09:12:25 GMT
Fix `fabric:get_db_info/1`

We weren't properly removing shards that had an error as well as
returning errors to functions that don't expect them.


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

Branch: refs/heads/windsor-merge-121
Commit: fdc0c8104ddd51d7b696392af6d399f42fb0ff12
Parents: a8b9e3f
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Oct 4 16:34:11 2013 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Jul 31 16:13:33 2014 +0100

----------------------------------------------------------------------
 src/fabric_db_info.erl | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/fdc0c810/src/fabric_db_info.erl
----------------------------------------------------------------------
diff --git a/src/fabric_db_info.erl b/src/fabric_db_info.erl
index 58139e8..de88632 100644
--- a/src/fabric_db_info.erl
+++ b/src/fabric_db_info.erl
@@ -21,9 +21,13 @@ go(DbName) ->
     Shards = mem3:shards(DbName),
     Workers = fabric_util:submit_jobs(Shards, get_db_info, []),
     RexiMon = fabric_util:create_monitors(Shards),
+    Fun = fun handle_message/3,
     Acc0 = {fabric_dict:init(Workers, nil), []},
     try
-        fabric_util:recv(Workers, #shard.ref, fun handle_message/3, Acc0)
+        case fabric_util:recv(Workers, #shard.ref, Fun, Acc0) of
+            {ok, Acc} -> {ok, Acc};
+            {error, Error} -> throw(Error)
+        end
     after
         rexi_monitor:stop(RexiMon)
     end.
@@ -37,7 +41,7 @@ handle_message({rexi_DOWN, _, {_,NodeRef},_}, _Shard, {Counters, Acc}) ->
     end;
 
 handle_message({rexi_EXIT, Reason}, Shard, {Counters, Acc}) ->
-    NewCounters = lists:keydelete(Shard, #shard.ref, Counters),
+    NewCounters = fabric_dict:erase(Shard, Counters),
     case fabric_view:is_progress_possible(NewCounters) of
     true ->
         {ok, {NewCounters, Acc}};


Mime
View raw message