mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-07 00:55:21 +00:00
Merge pull request #362 from basho/adt-cluster-of-one
Fix building clusters of one node
This commit is contained in:
commit
fb3191c7cd
13
src/rt.erl
13
src/rt.erl
@ -768,9 +768,16 @@ build_cluster(NumNodes, Versions, InitialConfig) ->
|
|||||||
|
|
||||||
%% Join nodes
|
%% Join nodes
|
||||||
[Node1|OtherNodes] = Nodes,
|
[Node1|OtherNodes] = Nodes,
|
||||||
[staged_join(Node, Node1) || Node <- OtherNodes],
|
case OtherNodes of
|
||||||
|
[] ->
|
||||||
plan_and_commit(Node1),
|
%% no other nodes, nothing to join/plan/commit
|
||||||
|
ok;
|
||||||
|
_ ->
|
||||||
|
%% ok do a staged join and then commit it, this eliminates the
|
||||||
|
%% large amount of redundant handoff done in a sequential join
|
||||||
|
[staged_join(Node, Node1) || Node <- OtherNodes],
|
||||||
|
plan_and_commit(Node1)
|
||||||
|
end,
|
||||||
|
|
||||||
?assertEqual(ok, wait_until_nodes_ready(Nodes)),
|
?assertEqual(ok, wait_until_nodes_ready(Nodes)),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user