diff --git a/client_tests/python/boto_tests/boto_test.py b/client_tests/python/boto_tests/boto_test.py index 2fcd3274e..5645e055e 100755 --- a/client_tests/python/boto_tests/boto_test.py +++ b/client_tests/python/boto_tests/boto_test.py @@ -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) diff --git a/client_tests/python/boto_tests/requirements.txt b/client_tests/python/boto_tests/requirements.txt index e4f66645d..1aa451715 100644 --- a/client_tests/python/boto_tests/requirements.txt +++ b/client_tests/python/boto_tests/requirements.txt @@ -1,2 +1,2 @@ -boto==2.9.0 -wsgiref==0.1.2 +boto==2.35.1 + diff --git a/dialyzer.ignore-warnings.ee b/dialyzer.ignore-warnings.ee index 0fd47108f..3a217d4a4 100644 --- a/dialyzer.ignore-warnings.ee +++ b/dialyzer.ignore-warnings.ee @@ -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 @@ -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 diff --git a/rebar.config b/rebar.config index deb008668..b27891624 100644 --- a/rebar.config +++ b/rebar.config @@ -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"}}} ]}. diff --git a/riak_test/src/rtcs.erl b/riak_test/src/rtcs.erl index 49b0bd589..a1d3dccb4 100644 --- a/riak_test/src/rtcs.erl +++ b/riak_test/src/rtcs.erl @@ -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)} | @@ -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). diff --git a/riak_test/tests/upgrade_downgrade_test.erl b/riak_test/tests/upgrade_downgrade_test.erl index c9e803cf8..d304f598c 100644 --- a/riak_test/tests/upgrade_downgrade_test.erl +++ b/riak_test/tests/upgrade_downgrade_test.erl @@ -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)), @@ -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), @@ -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), @@ -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], diff --git a/src/riak_cs_block_server.erl b/src/riak_cs_block_server.erl index 446598159..2c40571ab 100644 --- a/src/riak_cs_block_server.erl +++ b/src/riak_cs_block_server.erl @@ -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, @@ -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), @@ -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)), diff --git a/src/riak_cs_copy_object.erl b/src/riak_cs_copy_object.erl index f8ad99d73..226b1bb48 100644 --- a/src/riak_cs_copy_object.erl +++ b/src/riak_cs_copy_object.erl @@ -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} -> diff --git a/src/riak_cs_gc_key_list.erl b/src/riak_cs_gc_key_list.erl index 15f1a5a7e..b69c3a123 100644 --- a/src/riak_cs_gc_key_list.erl +++ b/src/riak_cs_gc_key_list.erl @@ -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}) -> @@ -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 -> diff --git a/src/riak_cs_wm_object.erl b/src/riak_cs_wm_object.erl index 8e53ed7a5..7a77a9a67 100644 --- a/src/riak_cs_wm_object.erl +++ b/src/riak_cs_wm_object.erl @@ -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