-
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
Add audit tool to extract inconsistencies between users and buckets #1202
Conversation
Note: this work is for #1161 (RCS-211) . |
{ok, RcPid} = riak_cs_riak_client:start_link([]), | ||
try | ||
Inconsistencies = audit_bucket_ownership0(RcPid), | ||
io:format("~p", [Inconsistencies]) |
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.
~n
would make this look better. Also, a message like "No inconsistency found." will be more informative when Inconsistencies
is just []
.
It worked; $ curl -XPUT 'http://localhost:8098/buckets/moss.buckets/keys/test' -H "X-Riak-Vclock: a85hYGBgzGDKBVI8ypz/fp7QY+KCCCUy5rEyKCjLnOfLAgA=" -d "sub-key"
$ rel/riak-cs/bin/riak-cs-admin audit-bucket-ownership
[{different_user,{<<"admin-key">>,<<"test">>,<<"sub-key">>}},
{not_tracked,{<<"sub-key">>,<<"test">>}}] We would follow this with some pretty printing or documentation. |
Inconsistencies0 = | ||
gb_sets:fold( | ||
fun ({U, B}, Acc) -> | ||
lager:info( |
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.
It would also be nice to output console.
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.
By discussion in chat, output to console may be very noisy when large number of inconsistencies.
- Explicitly output "no inconsistecies" - For tuple output, add period in order to consult the output afterward and line break for human friendliness
Thanks for review 😄 Updated. |
Add audit tool to extract inconsistencies between users and buckets Reviewed-by: kuenishi
@borshop merge |
For release note: please look at the description at the top. |
micro benchmark with 100,000 users and 27,000 buckets and small inconsistencies:
|
In local environment (single node cluster with ring size 8, not good for benchmark), it took a few seconds for list keys, it seems that getting every object in serialized way is current bottleneck. But, one more point, Riak CS node consumes CPU ~ 300%. Feels strange. Further investigation / optimization may follow in another ticket / issue. |
There is possibility of inconsistencies between the user bucket
moss.users
and the buckets bucket
moss.buckets
because no transaction is (can be) used.This PR adds tool for detecting inconsistencies between them.
Three kinds of inconsistencies:
in its value. (
{not_tracked, {User, Bucket}}
)exists. (
{no_bucket_object, {User, Bucket}}
)owned by different user. (
{different_user, {User, Bucket, DifferentUser}}
)Sample execution by console command and log output in it:
This PR is in the state of request-for-comment. Any comments on categorization,
log format, command line output, implementation, etc is appreciated.