Activate bucket properties in a wait_until block

Pre3 commits require bucket types to be activated. Without this patch
verify_dt_converge hangs
This commit is contained in:
Russell Brown 2013-10-07 15:35:44 +01:00
parent d4dc7fd7c5
commit 3a0fd5c919

View File

@ -98,8 +98,15 @@ create_bucket_types([N1|_]=Nodes, Types) ->
[ rpc:call(N1, riak_core_bucket_type, create,
[Name, [{datatype, Type}, {allow_mult, true}]]) ||
{Name, Type} <- Types ],
[rt:wait_until(N1, bucket_type_ready_fun(Name)) || {Name, _Type} <- Types],
[ rt:wait_until(N, bucket_type_matches_fun(Types)) || N <- Nodes].
bucket_type_ready_fun(Name) ->
fun(Node) ->
Res = rpc:call(Node, riak_core_bucket_type, activate, [Name]),
lager:info("is ~p ready ~p?", [Name, Res]),
Res == ok
end.
bucket_type_matches_fun(Types) ->
fun(Node) ->