Skip to content

Commit

Permalink
Update to review comments; stop manifst FSM after manifest move
Browse files Browse the repository at this point in the history
  • Loading branch information
kuenishi committed Jan 6, 2016
1 parent dc54e2b commit 11a84eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
20 changes: 4 additions & 16 deletions riak_test/tests/regression_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ verify_cs770({UserConfig, {RiakNodes, _, _}}, BucketName) ->
ok = gen_tcp:close(Socket),
%% This wait is just for convenience
timer:sleep(1000),
retry(8, 4096,
fun() ->
[[{UUID, Mx}]] = get_manifests(RiakNodes, BucketName, Key),
scheduled_delete =:= Mx?MANIFEST.state
end),
rt:wait_until(fun() ->
[[{UUID, Mx}]] = get_manifests(RiakNodes, BucketName, Key),
scheduled_delete =:= Mx?MANIFEST.state
end, 8, 4096),

Pbc = rt:pbc('dev1@127.0.0.1'),

Expand All @@ -198,17 +197,6 @@ verify_cs770({UserConfig, {RiakNodes, _, _}}, BucketName) ->
?assertEqual(ok, erlcloud_s3:delete_bucket(BucketName, UserConfig)),
ok.

retry(0, _, _) ->
throw(retry_over);
retry(N, Interval, Fun) ->
case Fun() of
false ->
timer:sleep(Interval),
retry(N-1, Interval, Fun);
true ->
true
end.

all_manifests_in_gc_bucket(Pbc) ->
{ok, Keys} = riakc_pb_socket:list_keys(Pbc, ?GC_BUCKET),
Ms = rt:pmap(fun(K) ->
Expand Down
2 changes: 1 addition & 1 deletion src/riak_cs_manifest_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ waiting_update_command({gc_specific_manifest, UUID}, _From,
riak_cs_gc:gc_specific_manifests([UUID], RiakObj,
Bucket, Key, RcPid)
end,
{reply, Res, waiting_update_command, State}.
{stop, normal, Res, State}.

handle_event(_Event, StateName, State) ->
{next_state, StateName, State}.
Expand Down

0 comments on commit 11a84eb

Please sign in to comment.