From 3c34b1fe5bf911367db092674cc650f0ce96d54d Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 26 Aug 2013 12:51:52 -0400 Subject: [PATCH] Fix building clusters of one node This fixes the issue added by switching to staged joins that you could not build clusters of a single node. --- src/rt.erl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/rt.erl b/src/rt.erl index 89465fa6..46c80adb 100644 --- a/src/rt.erl +++ b/src/rt.erl @@ -762,9 +762,16 @@ build_cluster(NumNodes, Versions, InitialConfig) -> %% Join nodes [Node1|OtherNodes] = Nodes, - [staged_join(Node, Node1) || Node <- OtherNodes], - - plan_and_commit(Node1), + case OtherNodes of + [] -> + %% 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)),