-
Notifications
You must be signed in to change notification settings - Fork 95
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
Make all kind of timeouts hitting Riak configurable #1021
Changes from 5 commits
100a5e8
40389f2
57dc470
314c22a
03ff60c
0f2c354
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,7 +353,7 @@ mark_manifests(RiakObject, Bucket, Key, UUIDsToMark, ManiFunction, RcPid) -> | |
%% with vector clock. This allows us to do a PUT | ||
%% again without having to re-retrieve the object | ||
{ok, ManifestPbc} = riak_cs_riak_client:manifest_pbc(RcPid), | ||
riak_cs_pbc:put(ManifestPbc, UpdObj, [return_body]). | ||
riak_cs_pbc:put(ManifestPbc, UpdObj, [return_body], riak_cs_config:get_gckey_timeout()). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put manifest? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, |
||
|
||
%% @doc Copy data for a list of manifests to the | ||
%% `riak-cs-gc' bucket to schedule them for deletion. | ||
|
@@ -365,8 +365,9 @@ move_manifests_to_gc_bucket(Manifests, RcPid) -> | |
Key = generate_key(), | ||
ManifestSet = build_manifest_set(Manifests), | ||
{ok, ManifestPbc} = riak_cs_riak_client:manifest_pbc(RcPid), | ||
Timeout = riak_cs_config:get_gckey_timeout(), | ||
ObjectToWrite = | ||
case riakc_pb_socket:get(ManifestPbc, ?GC_BUCKET, Key) of | ||
case riakc_pb_socket:get(ManifestPbc, ?GC_BUCKET, Key, Timeout) of | ||
{error, notfound} -> | ||
%% There was no previous value, so we'll | ||
%% create a new riak object and write it | ||
|
@@ -383,7 +384,8 @@ move_manifests_to_gc_bucket(Manifests, RcPid) -> | |
|
||
%% Create a set from the list of manifests | ||
_ = lager:debug("Manifests scheduled for deletion: ~p", [ManifestSet]), | ||
riak_cs_pbc:put(ManifestPbc, ObjectToWrite). | ||
Timeout1 = riak_cs_config:put_gckey_timeout(), | ||
riak_cs_pbc:put(ManifestPbc, ObjectToWrite, Timeout1). | ||
|
||
-spec build_manifest_set([cs_uuid_and_manifest()]) -> twop_set:twop_set(). | ||
build_manifest_set(Manifests) -> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,8 +302,7 @@ fetch_key_list(RcPid, Request, State, false) -> | |
-spec make_list_keys_request(riak_client(), list_object_request()) -> | ||
streaming_req_response(). | ||
make_list_keys_request(RcPid, ?LOREQ{name=BucketName}) -> | ||
%% hardcoded for now | ||
ServerTimeout = timer:seconds(60), | ||
ServerTimeout = riak_cs_config:list_keys_list_objects_timeout(), | ||
ManifestBucket = riak_cs_utils:to_bucket_name(objects, BucketName), | ||
{ok, ManifestPbc} = riak_cs_riak_client:manifest_pbc(RcPid), | ||
riakc_pb_socket:stream_list_keys(ManifestPbc, | ||
|
@@ -493,9 +492,9 @@ make_bkeys(ManifestBucketName, Keys) -> | |
-spec send_map_reduce_request(riak_client(), list()) -> streaming_req_response(). | ||
send_map_reduce_request(RcPid, BKeyTuples) -> | ||
%% TODO: change this: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this comment any more because TODO has been done here? |
||
%% hardcode 60 seconds for now | ||
%% default 60 seconds for now | ||
{ok, ManifestPbc} = riak_cs_riak_client:manifest_pbc(RcPid), | ||
Timeout = timer:seconds(60), | ||
Timeout = riak_cs_config:list_objects_timeout(), | ||
riakc_pb_socket:mapred_stream(ManifestPbc, | ||
BKeyTuples, | ||
mapred_query(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#743 and #759 were fix for crash caused by timeout. So the assertion here should be
?assertEqual
to check calculation has successfully detected the timeout without crashing. This timeout setting which is not working any more should be changed tostorage_calc_timeout
.