couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [24/50] mem3 commit: updated refs/heads/master to 64c0c74
Date Thu, 28 Aug 2014 12:22:44 GMT
Refuse to place shards on decom:true nodes

BugzID: 24420


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

Branch: refs/heads/master
Commit: 45b040b4c6bb554a4ee496735ec6701c6b5f7c42
Parents: d7a4f26
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Wed Oct 23 10:08:51 2013 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Wed Jul 23 18:46:26 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/45b040b4/src/mem3.erl
----------------------------------------------------------------------
diff --git a/src/mem3.erl b/src/mem3.erl
index 864cddb..cc76454 100644
--- a/src/mem3.erl
+++ b/src/mem3.erl
@@ -157,7 +157,7 @@ choose_shards(DbName, Options) when is_list(DbName) ->
 choose_shards(DbName, Options) ->
     try shards(DbName)
     catch error:E when E==database_does_not_exist; E==badarg ->
-        Nodes = mem3:nodes(),
+        Nodes = allowed_nodes(),
         case get_placement(Options) of
             undefined ->
                 choose_shards(DbName, Nodes, Options);
@@ -237,6 +237,9 @@ range(<<"shards/", Start:8/binary, "-", End:8/binary, "/", _/binary>>)
->
     [httpd_util:hexlist_to_integer(binary_to_list(Start)),
      httpd_util:hexlist_to_integer(binary_to_list(End))].
 
+allowed_nodes() ->
+    [Node || Node <- mem3:nodes(), mem3:node_info(Node, <<"decom">>) =/= true].
+
 nodes_in_zone(Nodes, Zone) ->
     [Node || Node <- Nodes, Zone == mem3:node_info(Node, <<"zone">>)].
 


Mime
View raw message