Fix my refactor error and add some debug

This commit is contained in:
Chris Tilt 2013-01-29 20:37:36 -08:00
parent 9ea8477e6e
commit 109d464c76
2 changed files with 12 additions and 5 deletions

View File

@ -167,6 +167,7 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) ->
?assertEqual([], do_write(ASecond, 301, 400, TestBucket, 2)),
%% verify data is replicated to B
rt:wait_until_pingable(BSecond),
lager:info("Reading 101 keys written to ~p from ~p", [ASecond, BSecond]),
?assertEqual(0, wait_for_reads(BSecond, 301, 400, TestBucket, 2)),
@ -254,7 +255,6 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) ->
lager:info("Nodes restarted"),
case nodes_all_have_version(ANodes, "1.1.0") of
true ->

View File

@ -44,25 +44,32 @@ confirm() ->
erlang:exit()
end,
lager:info("Upgrading nodes in order: ~p", [NodeUpgrades]),
ClusterASize = rt:config(cluster_a_size, 3),
{ANodes, BNodes} = lists:split(ClusterASize, Nodes),
lager:info("ANodes: ~p", [ANodes]),
lager:info("BNodes: ~p", [BNodes]),
lager:info("Build cluster A"),
replication:make_cluster(ANodes),
repl_util:make_cluster(ANodes),
lager:info("Build cluster B"),
replication:make_cluster(BNodes),
repl_util:make_cluster(BNodes),
lager:info("Replication First pass...homogenous cluster"),
%% initial replication run, homogeneous cluster
replication:replication(ANodes, BNodes, false),
lager:info("Upgrading nodes in order: ~p", [NodeUpgrades]),
rt:log_to_nodes(Nodes, "Upgrading nodes in order: ~p", [NodeUpgrades]),
%% upgrade the nodes, one at a time
lists:foreach(fun(Node) ->
lager:info("Upgrade node: ~p", [Node]),
rt:log_to_nodes(Nodes, "Upgrade node: ~p", [Node]),
rtdev:upgrade(Node, current),
rt:wait_until_pingable(Node),
timer:sleep(1000),
lager:info("Replication with upgraded node: ~p", [Node]),
rt:log_to_nodes(Nodes, "Replication with upgraded node: ~p", [Node]),
replication:replication(ANodes, BNodes, true)
end, NodeUpgrades).