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

handle timeout error on sum_bucket/2 #759

Merged
merged 3 commits into from
Dec 28, 2013
Merged

Conversation

kuenishi
Copy link
Contributor

addresses #743.
from commit message:

add error handling when sum_bucket failed with timeout, which
causes dirty error message and no way to know which bucket was
failed in usage calculation mapreduce. This commit adds two ways
to know that:

- outputs an error log that prints user key id and bucket name
  with error reason.
- stores the result into moss.storage with reason like:
    { "bucket_name" : "{error,{timeout,[]}}" }

The latter log proves and indicated there existed a bucket at
that time even though its usage size was unknown. Better than
ignored, which operator can't tell non-existent from calculation
failure.

causes dirty error message and no way to know which bucket was
failed in usage calculation mapreduce. This commit adds two ways
to know that:

- outputs an error log that prints user key id and bucket name
  with error reason.
- stores the result into moss.storage with reason like:
    { "bucket_name" : "{error,{timeout,[]}}" }

The latter log proves and indicated there existed a bucket at
that time even though its usage size was unknown. Better than
ignored, which operator can't tell non-existent from calculation
failure.
@andrewjstone
Copy link
Contributor

Code looks good.

  • cs743_regression_test riak_test
  • eunit + eqc
  • dialyzer
  • xref

@andrewjstone
Copy link
Contributor

I'm seeing the following dialyzer errors related to this change:

riak_cs_storage.erl:60: Invalid type specification for function riak_cs_storage:maybe_sum_bucket/3. The success typing is (pid(),[binary() | maybe_improper_list(any(),binary() | []) | byte()],binary() | [byte()]) -> {binary() | [byte()],binary()}
riak_cs_storage.erl:64: The pattern {'ok', BucketUsage} can never match the type {'error',_} | {'struct',[{_,_},...]}

@kuenishi
Copy link
Contributor Author

Hooray! It was totally a bug found by dialyzer.
This regression could be found if #703 were done.

@ghost ghost assigned kuenishi Dec 27, 2013
@andrewjstone
Copy link
Contributor

👍

kuenishi added a commit that referenced this pull request Dec 28, 2013
handle timeout error on sum_bucket/2
@kuenishi kuenishi merged commit 34d8321 into release/1.4 Dec 28, 2013
@kuenishi kuenishi deleted the bugfix/ku-cs-743-timeout branch December 28, 2013 11:50
{error, Error} ->
{error, Error}
end.

%% @doc Output a log when calculating total usage of a bucket.
%% This log is *very* important because unless this log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/unless/without

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh crap. Thank you for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants