Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependent modules #1047

Merged
merged 7 commits into from
Jan 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client_tests/python/boto_tests/boto_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,4 +815,4 @@ def test_put_copy_from_non_existing_key_404(self):
self.assertEqual(e.reason, 'Object Not Found')

if __name__ == "__main__":
unittest.main()
unittest.main(verbosity=2)
4 changes: 2 additions & 2 deletions client_tests/python/boto_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
boto==2.9.0
wsgiref==0.1.2
boto==2.35.1

6 changes: 3 additions & 3 deletions dialyzer.ignore-warnings.ee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Errors
Function get_block_remote/5 has no local return
riak_cs_config.erl:243: Function will never be called
riak_cs_block_server.erl:312: The pattern
riak_cs_block_server.erl:347: The pattern
riak_cs_config.erl:239: The pattern
# Warnings
Unknown functions:
app_helper:get_prop_or_env/3
Expand All @@ -20,4 +21,3 @@ Unknown types:
riak_kv_backend:fold_objects_fun/0
riak_object:bucket/0
riak_object:key/0
riakc_pb_socket:index_results/0
14 changes: 7 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@
]}.

{deps, [
{node_package, "1.3.8", {git, "git://github.com/basho/node_package", {tag, "1.3.8"}}},
{getopt, ".*", {git, "git://github.com/jcomellas/getopt.git", {tag, "v0.4.3"}}},
{webmachine, ".*", {git, "git://github.com/basho/webmachine", {tag, "1.10.3"}}},
{riakc, ".*", {git, "git://github.com/basho/riak-erlang-client", {tag, "1.4.2"}}},
{node_package, ".*", {git, "git://github.com/basho/node_package", {tag, "2.0.0"}}},
{getopt, ".*", {git, "git://github.com/jcomellas/getopt.git", {tag, "v0.8.2"}}},
{webmachine, ".*", {git, "git://github.com/basho/webmachine", {tag, "1.10.7"}}},
{riakc, ".*", {git, "git://github.com/basho/riak-erlang-client", {tag, "2.0.1"}}},
{lager, ".*", {git, "git://github.com/basho/lager", {tag, "2.0.3"}}},
{lager_syslog, ".*", {git, "git://github.com/basho/lager_syslog", {tag, "2.0.3"}}},
{eper, ".*", {git, "git://github.com/basho/eper.git", "0.78"}},
{druuid, ".*", {git, "git://github.com/kellymclaughlin/druuid.git", {tag, "0.2"}}},
{velvet, "1.3.*", {git, "git://github.com/basho/velvet", "4bb0fd664ff065c4082ca8dd2e0683e920537d15"}},
{poolboy, "0.8.*", {git, "git://github.com/basho/poolboy", "0.8.1p2"}},
{folsom, ".*", {git, "git://github.com/boundary/folsom", {tag, "0.8.1"}}},
{cluster_info, ".*", {git, "git://github.com/basho/cluster_info", {tag, "1.2.4"}}},
{folsom, ".*", {git, "git://github.com/boundary/folsom", {tag, "0.8.2"}}},
{cluster_info, ".*", {git, "git://github.com/basho/cluster_info", {tag, "2.0.0"}}},
{xmerl, ".*", {git, "git://github.com/shino/xmerl", "b35bcb05abaf27f183cfc3d85d8bffdde0f59325"}},
{erlcloud, ".*", {git, "git://github.com/basho/erlcloud.git", {tag, "0.4.4"}}},
{rebar_lock_deps_plugin, ".*", {git, "git://github.com/seth/rebar_lock_deps_plugin.git", {tag, "3.1.0"}}}
]}.

{deps_ee, [
{riak_repl_pb_api,".*",{git,"git@github.com:basho/riak_repl_pb_api.git", {tag, "0.2.5"}}},
{riak_repl_pb_api,".*",{git,"git@github.com:basho/riak_repl_pb_api.git", {tag, "2.0.0"}}},
{riak_cs_multibag,".*",{git,"git@github.com:basho/riak_cs_multibag.git", {branch, "master"}}}
]}.
46 changes: 29 additions & 17 deletions riak_test/src/rtcs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,15 @@ calculate_storage(N, Vsn) ->
lager:info("Running ~p", [Cmd]),
os:cmd(Cmd).

read_config(Vsn, N, Who) ->
Prefix = get_rt_config(Who, Vsn),
EtcPath = case Who of
cs -> riakcs_etcpath(Prefix, N);
stanchion -> stanchion_etcpath(Prefix)
end,
{ok, [Config]} = file:consult(EtcPath ++ "/app.config"),
Config.

update_cs_config(Prefix, N, Config, {AdminKey, AdminSecret}) ->
CSSection = proplists:get_value(riak_cs, Config),
UpdConfig = [{riak_cs, update_admin_creds(CSSection, AdminKey, AdminSecret)} |
Expand Down Expand Up @@ -893,20 +902,23 @@ upgrade_20(Node, NewVersion) ->
rt:wait_until_pingable(Node),
ok.

%% @doc from previous to current, assuming CS is already stopped
upgrade_cs(N, Config, AdminCreds) ->
upgrade_cs(N, Config, AdminCreds, current).

upgrade_cs(N, Config, AdminCreds, Vsn) ->
update_cs_config(get_rt_config(cs, Vsn),
N,
proplists:get_value(cs, Config),
AdminCreds),
ok.

upgrade_stanchion(Config, AdminCreds, Vsn) ->
update_stanchion_config(get_rt_config(stanchion, Vsn),
proplists:get_value(stanchion, Config),
AdminCreds).

%% maybe_stop_stanchion(1) ->
%% @doc update current app.config, assuming CS is already stopped
upgrade_cs(N, AdminCreds) ->
migrate_cs(previous, current, N, AdminCreds).

%% @doc copy and update config file from `From' to `To' version.
migrate_cs(From, To, N, AdminCreds) ->
migrate(From, To, N, AdminCreds, cs).

migrate(From, To, N, AdminCreds, Who) when
(From =:= current andalso To =:= previous)
orelse ( From =:= previous andalso To =:= current) ->
Config = read_config(From, N, Who),
Prefix = get_rt_config(Who, To),
case Who of
cs -> update_cs_config(Prefix, N, Config, AdminCreds);
stanchion -> update_stanchion_config(Prefix, Config, AdminCreds)
end.

migrate_stanchion(From, To, AdminCreds) ->
migrate(From, To, -1, AdminCreds, stanchion).
10 changes: 4 additions & 6 deletions riak_test/tests/upgrade_downgrade_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ confirm() ->
{ok, Data} = prepare_all_data(UserConfig),
ok = verify_all_data(UserConfig, Data),

NewConfig = rtcs:default_configs(),
AdminCreds = {UserConfig#aws_config.access_key_id,
UserConfig#aws_config.secret_access_key},

{_, RiakCurrentVsn} =
rtcs:riak_root_and_vsn(current, rt_config:get(build_type, oss)),

Expand All @@ -52,13 +50,13 @@ confirm() ->
rtcs:stop_cs(N, previous),
ok = rtcs:upgrade_20(RiakNode, RiakCurrentVsn),
rt:wait_for_service(RiakNode, riak_kv),
ok = rtcs:upgrade_cs(N, NewConfig, AdminCreds),
ok = rtcs:upgrade_cs(N, AdminCreds),
rtcs:start_cs(N, current)
end
|| RiakNode <- RiakNodes],
rt:wait_until_ring_converged(RiakNodes),
rtcs:stop_stanchion(previous),
rtcs:upgrade_stanchion(NewConfig, AdminCreds, current),
rtcs:migrate_stanchion(previous, current, AdminCreds),
rtcs:start_stanchion(current),

ok = verify_all_data(UserConfig, Data),
Expand All @@ -73,7 +71,7 @@ confirm() ->

%% Downgrade!!
rtcs:stop_stanchion(current),
rtcs:upgrade_stanchion(PrevConfig, AdminCreds, previous),
rtcs:migrate_stanchion(current, previous, AdminCreds),
rtcs:start_stanchion(previous),
[begin
N = rt_cs_dev:node_id(RiakNode),
Expand All @@ -95,7 +93,7 @@ confirm() ->

ok = rtcs:upgrade_20(RiakNode, RiakPrevVsn),
rt:wait_for_service(RiakNode, riak_kv),
ok = rtcs:upgrade_cs(N, PrevConfig, AdminCreds, previous),
ok = rtcs:migrate_cs(current, previous, N, AdminCreds),
rtcs:start_cs(N, previous)
end
|| RiakNode <- RiakNodes],
Expand Down
5 changes: 5 additions & 0 deletions src/riak_cs_block_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

-include("riak_cs.hrl").
-include_lib("riak_pb/include/riak_pb_kv_codec.hrl").
-include_lib("riakc/include/riakc.hrl").

%% API
-export([start_link/1, start_link/2,
Expand Down Expand Up @@ -335,6 +336,8 @@ get_block_local(RcPid, FullBucket, FullKey, GetOptions, Timeout) ->
Else
end.

-spec get_block_remote(riak_client(), binary(), binary(), binary(), get_options()) ->
{ok, binary()} | {error, term()}.
get_block_remote(RcPid, FullBucket, FullKey, ClusterID, GetOptions0) ->
%% replace get_block_timeout with proxy_get_block_timeout
GetOptions = proplists:delete(timeout, GetOptions0),
Expand Down Expand Up @@ -468,6 +471,8 @@ full_bkey(Bucket, Key, UUID, BlockId) ->
find_md_usermeta(MD) ->
dict:find(?MD_USERMETA, MD).

-spec resolve_block_object(riakc_obj:riakc_obj(), riak_client()) ->
{ok, binary()} | {error, notfound}.
resolve_block_object(RObj, RcPid) ->
{{MD, Value}, NeedRepair} =
riak_cs_utils:resolve_robj_siblings(riakc_obj:get_contents(RObj)),
Expand Down
2 changes: 1 addition & 1 deletion src/riak_cs_copy_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ connection_checker(Socket) ->
{error,_E} ->
false;
{ok,_} ->
case gen_tcp:recv(Socket, 1, 0) of
case gen_tcp:recv(Socket, 0, 0) of
{error, timeout} ->
true;
{error, _E} ->
Expand Down
4 changes: 2 additions & 2 deletions src/riak_cs_gc_key_list.erl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ split_at_most_n(0, L, Acc) ->
split_at_most_n(N, [H|T], Acc) ->
split_at_most_n(N-1, T, [H|Acc]).

-spec continuation({{ok, riakc_pb_socket:index_results()} | {error, term()}, binary()}) ->
-spec continuation({{ok, index_results()} | {error, term()}, binary()}) ->
continuation().
continuation({{ok, ?INDEX_RESULTS{continuation=Continuation}},
_EndTime}) ->
Expand All @@ -141,7 +141,7 @@ continuation({{error, _}, _EndTime}) ->
undefined.

-spec gc_index_query(riak_client(), binary(), non_neg_integer(), continuation(), boolean()) ->
{{ok, riakc_pb_socket:index_results()} | {error, term()}, binary()}.
{{ok, index_results()} | {error, term()}, binary()}.
gc_index_query(RcPid, EndTime, BatchSize, Continuation, UsePaginatedIndexes) ->
Options = case UsePaginatedIndexes of
true ->
Expand Down
2 changes: 2 additions & 0 deletions src/riak_cs_wm_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ handle_copy_put(RD, Ctx, SrcBucket, SrcKey) ->
end;
{error, notfound} ->
ResponseMod:api_error(no_such_key, RD, Ctx);
{error, no_active_manifest} ->
ResponseMod:api_error(no_such_key, RD, Ctx);
{error, Err} ->
ResponseMod:api_error(Err, RD, Ctx)
end
Expand Down