mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Updated tests to explicitly set allow_mult and dvv_enabled, as
overriding default_bucket_props in advanced_config without
explicitly setting these returns different values with the fix for
allow_mult turning to true with an app.config file present.
Cherry-picked from 619b24e
This commit is contained in:
parent
bc892ece50
commit
6665465d62
@ -721,7 +721,13 @@ wait_until_no_pending_changes(Nodes) ->
|
|||||||
rpc:multicall(Nodes, riak_core_vnode_manager, force_handoffs, []),
|
rpc:multicall(Nodes, riak_core_vnode_manager, force_handoffs, []),
|
||||||
{Rings, BadNodes} = rpc:multicall(Nodes, riak_core_ring_manager, get_raw_ring, []),
|
{Rings, BadNodes} = rpc:multicall(Nodes, riak_core_ring_manager, get_raw_ring, []),
|
||||||
Changes = [ riak_core_ring:pending_changes(Ring) =:= [] || {ok, Ring} <- Rings ],
|
Changes = [ riak_core_ring:pending_changes(Ring) =:= [] || {ok, Ring} <- Rings ],
|
||||||
BadNodes =:= [] andalso length(Changes) =:= length(Nodes) andalso lists:all(fun(T) -> T end, Changes)
|
case BadNodes =:= [] andalso length(Changes) =:= length(Nodes) andalso lists:all(fun(T) -> T end, Changes) of
|
||||||
|
true -> true;
|
||||||
|
false ->
|
||||||
|
NodesWithChanges = [Node || {Node, false} <- lists:zip(Nodes -- BadNodes, Changes)],
|
||||||
|
lager:info("Changes not yet complete, or bad nodes. BadNodes=~p, Nodes with Pending Changes=~p~n", [BadNodes, NodesWithChanges]),
|
||||||
|
false
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
?assertEqual(ok, wait_until(F)),
|
?assertEqual(ok, wait_until(F)),
|
||||||
ok.
|
ok.
|
||||||
|
@ -10,7 +10,11 @@ confirm() ->
|
|||||||
lager:info("Deploy some nodes"),
|
lager:info("Deploy some nodes"),
|
||||||
Nodes = rt:build_cluster(4, [], [
|
Nodes = rt:build_cluster(4, [], [
|
||||||
{riak_core, [{default_bucket_props,
|
{riak_core, [{default_bucket_props,
|
||||||
[{n_val, 2}]}]}]),
|
[
|
||||||
|
{n_val, 2},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}]}]),
|
||||||
Node = hd(Nodes),
|
Node = hd(Nodes),
|
||||||
|
|
||||||
RMD = riak_test_runner:metadata(),
|
RMD = riak_test_runner:metadata(),
|
||||||
|
@ -56,7 +56,7 @@ confirm() ->
|
|||||||
test_lose_minority_synctrees(PBC, Bucket, Key, Val, PL),
|
test_lose_minority_synctrees(PBC, Bucket, Key, Val, PL),
|
||||||
test_lose_majority_synctrees(PBC, Bucket, Key, Val, PL),
|
test_lose_majority_synctrees(PBC, Bucket, Key, Val, PL),
|
||||||
test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val,
|
test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val,
|
||||||
PL, Nodes),
|
PL, Nodes),
|
||||||
test_lose_all_data_and_trees_except_one_node(PBC, Bucket, Key, Val, PL),
|
test_lose_all_data_and_trees_except_one_node(PBC, Bucket, Key, Val, PL),
|
||||||
{ok, _NewVal} = test_backup_restore_data_not_trees(Bucket, Key, Val, PL),
|
{ok, _NewVal} = test_backup_restore_data_not_trees(Bucket, Key, Val, PL),
|
||||||
test_lose_all_data(PBC, Bucket, Key, PL),
|
test_lose_all_data(PBC, Bucket, Key, PL),
|
||||||
@ -64,7 +64,12 @@ confirm() ->
|
|||||||
pass.
|
pass.
|
||||||
|
|
||||||
config() ->
|
config() ->
|
||||||
[{riak_core, [{default_bucket_props, [{n_val, 5}]},
|
[{riak_core, [{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 5},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]},
|
||||||
{vnode_management_timer, 1000},
|
{vnode_management_timer, 1000},
|
||||||
{ring_creation_size, 16},
|
{ring_creation_size, 16},
|
||||||
{enable_consensus, true},
|
{enable_consensus, true},
|
||||||
@ -79,7 +84,7 @@ test_lose_majority_synctrees(PBC, Bucket, Key, Val, PL) ->
|
|||||||
assert_lose_synctrees_and_recover(PBC, Bucket, Key, Val, PL, Majority).
|
assert_lose_synctrees_and_recover(PBC, Bucket, Key, Val, PL, Majority).
|
||||||
|
|
||||||
test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val, PL,
|
test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val, PL,
|
||||||
Nodes) ->
|
Nodes) ->
|
||||||
Minority = minority_vnodes(PL),
|
Minority = minority_vnodes(PL),
|
||||||
{{Idx0, Node0}, primary} = hd(PL),
|
{{Idx0, Node0}, primary} = hd(PL),
|
||||||
Ensemble = {kv, Idx0, 5},
|
Ensemble = {kv, Idx0, 5},
|
||||||
@ -251,7 +256,7 @@ kill_peers(Ensemble, Nodes) ->
|
|||||||
Peers = [P || P={_Id, N} <- View, lists:member(N, Nodes)],
|
Peers = [P || P={_Id, N} <- View, lists:member(N, Nodes)],
|
||||||
lager:info("Killing Peers: ~p", [Peers]),
|
lager:info("Killing Peers: ~p", [Peers]),
|
||||||
Pids = [rpc:call(Node, riak_ensemble_manager, get_peer_pid,
|
Pids = [rpc:call(Node, riak_ensemble_manager, get_peer_pid,
|
||||||
[Ensemble, Peer]) || Peer <- Peers],
|
[Ensemble, Peer]) || Peer <- Peers],
|
||||||
[exit(Pid, kill) || Pid <- Pids, Pid =/= undefined].
|
[exit(Pid, kill) || Pid <- Pids, Pid =/= undefined].
|
||||||
|
|
||||||
wipe_partitions(PL) ->
|
wipe_partitions(PL) ->
|
||||||
|
@ -27,7 +27,12 @@
|
|||||||
-define(RING_SIZE, 16).
|
-define(RING_SIZE, 16).
|
||||||
|
|
||||||
config() ->
|
config() ->
|
||||||
[{riak_core, [{default_bucket_props, [{n_val, 5}]},
|
[{riak_core, [{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 5},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]},
|
||||||
{vnode_management_timer, 1000},
|
{vnode_management_timer, 1000},
|
||||||
{ring_creation_size, ?RING_SIZE},
|
{ring_creation_size, ?RING_SIZE},
|
||||||
{enable_consensus, true},
|
{enable_consensus, true},
|
||||||
|
@ -58,10 +58,15 @@ fast_config(Nval, EnableAAE) when is_boolean(EnableAAE) ->
|
|||||||
|
|
||||||
fast_config(NVal, RingSize, EnableAAE) ->
|
fast_config(NVal, RingSize, EnableAAE) ->
|
||||||
[config_aae(EnableAAE),
|
[config_aae(EnableAAE),
|
||||||
{riak_core, [{default_bucket_props, [{n_val, NVal}]},
|
{riak_core, [{default_bucket_props,
|
||||||
{vnode_management_timer, 1000},
|
[
|
||||||
{ring_creation_size, RingSize},
|
{n_val, NVal,
|
||||||
{enable_consensus, true}]}].
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}}
|
||||||
|
]},
|
||||||
|
{vnode_management_timer, 1000},
|
||||||
|
{ring_creation_size, RingSize},
|
||||||
|
{enable_consensus, true}]}].
|
||||||
|
|
||||||
config_aae(true) ->
|
config_aae(true) ->
|
||||||
{riak_kv, [{anti_entropy_build_limit, {100, 1000}},
|
{riak_kv, [{anti_entropy_build_limit, {100, 1000}},
|
||||||
|
@ -13,7 +13,11 @@ confirm() ->
|
|||||||
lager:info("Deploy some nodes"),
|
lager:info("Deploy some nodes"),
|
||||||
Nodes = rt:build_cluster(4, [], [
|
Nodes = rt:build_cluster(4, [], [
|
||||||
{riak_core, [{default_bucket_props,
|
{riak_core, [{default_bucket_props,
|
||||||
[{n_val, 2}]}]}]),
|
[
|
||||||
|
{n_val, 2},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}]}]),
|
||||||
Node = hd(Nodes),
|
Node = hd(Nodes),
|
||||||
|
|
||||||
RMD = riak_test_runner:metadata(),
|
RMD = riak_test_runner:metadata(),
|
||||||
|
@ -30,7 +30,7 @@ confirm() ->
|
|||||||
PrivDir = rt:priv_dir(),
|
PrivDir = rt:priv_dir(),
|
||||||
Conf = [
|
Conf = [
|
||||||
{riak_core, [
|
{riak_core, [
|
||||||
{default_bucket_props, [{allow_mult, true}]},
|
{default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]},
|
||||||
{ssl, [
|
{ssl, [
|
||||||
{certfile, filename:join([CertDir,
|
{certfile, filename:join([CertDir,
|
||||||
"site3.basho.com/cert.pem"])},
|
"site3.basho.com/cert.pem"])},
|
||||||
|
@ -57,7 +57,12 @@ default_config(#config{
|
|||||||
fsm_limit = FsmLimit
|
fsm_limit = FsmLimit
|
||||||
}) ->
|
}) ->
|
||||||
[{riak_core, [{ring_creation_size, 8},
|
[{riak_core, [{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, 5}]},
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 5},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]},
|
||||||
{vnode_management_timer, 1000},
|
{vnode_management_timer, 1000},
|
||||||
{enable_health_checks, false},
|
{enable_health_checks, false},
|
||||||
{enable_consensus, true},
|
{enable_consensus, true},
|
||||||
|
@ -53,7 +53,7 @@ confirm() ->
|
|||||||
PrivDir = rt:priv_dir(),
|
PrivDir = rt:priv_dir(),
|
||||||
Conf = [
|
Conf = [
|
||||||
{riak_core, [
|
{riak_core, [
|
||||||
{default_bucket_props, [{allow_mult, true}]},
|
{default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]},
|
||||||
{ssl, [
|
{ssl, [
|
||||||
{certfile, filename:join([CertDir,"site3.basho.com/cert.pem"])},
|
{certfile, filename:join([CertDir,"site3.basho.com/cert.pem"])},
|
||||||
{keyfile, filename:join([CertDir, "site3.basho.com/key.pem"])},
|
{keyfile, filename:join([CertDir, "site3.basho.com/key.pem"])},
|
||||||
|
@ -16,7 +16,12 @@
|
|||||||
{riak_core,
|
{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 8},
|
{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, 1}]}
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 1},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{riak_kv,
|
{riak_kv,
|
||||||
|
@ -22,7 +22,12 @@ confirm() ->
|
|||||||
{riak_core,
|
{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 8},
|
{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, 1}]}
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 1},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{riak_kv,
|
{riak_kv,
|
||||||
|
@ -11,7 +11,12 @@
|
|||||||
{riak_core,
|
{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 8},
|
{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, 1}]}
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 1},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{riak_kv,
|
{riak_kv,
|
||||||
|
@ -13,7 +13,12 @@
|
|||||||
{riak_core,
|
{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 8},
|
{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, 1}]}
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, 1},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{riak_kv,
|
{riak_kv,
|
||||||
|
@ -11,7 +11,12 @@
|
|||||||
{riak_core,
|
{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 8},
|
{ring_creation_size, 8},
|
||||||
{default_bucket_props, [{n_val, ?N}]}
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, ?N},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{riak_kv,
|
{riak_kv,
|
||||||
|
@ -62,7 +62,7 @@ confirm() ->
|
|||||||
make_clusters() ->
|
make_clusters() ->
|
||||||
Conf = [{riak_repl, [{fullsync_on_connect, false},
|
Conf = [{riak_repl, [{fullsync_on_connect, false},
|
||||||
{fullsync_interval, disabled}]},
|
{fullsync_interval, disabled}]},
|
||||||
{riak_core, [{default_bucket_props, [{allow_mult, true}]}]}],
|
{riak_core, [{default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]}]}],
|
||||||
Nodes = rt:deploy_nodes(6, Conf, [riak_kv, riak_repl]),
|
Nodes = rt:deploy_nodes(6, Conf, [riak_kv, riak_repl]),
|
||||||
{ClusterA, ClusterB} = lists:split(3, Nodes),
|
{ClusterA, ClusterB} = lists:split(3, Nodes),
|
||||||
A = make_cluster(ClusterA, "A"),
|
A = make_cluster(ClusterA, "A"),
|
||||||
|
@ -38,7 +38,12 @@
|
|||||||
[{riak_core,
|
[{riak_core,
|
||||||
[
|
[
|
||||||
{ring_creation_size, 16},
|
{ring_creation_size, 16},
|
||||||
{default_bucket_props, [{n_val, ?N}]},
|
{default_bucket_props,
|
||||||
|
[
|
||||||
|
{n_val, ?N},
|
||||||
|
{allow_mult, true},
|
||||||
|
{dvv_enabled, true}
|
||||||
|
]},
|
||||||
{anti_entropy_build_limit, {100, 1000}},
|
{anti_entropy_build_limit, {100, 1000}},
|
||||||
{anti_entropy_concurrency, 8}
|
{anti_entropy_concurrency, 8}
|
||||||
]},
|
]},
|
||||||
|
Loading…
Reference in New Issue
Block a user