-
Notifications
You must be signed in to change notification settings - Fork 94
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
Orphan block scanner scripts [2.1] #1133
Conversation
Originally written by Andrew J. Stone
…etc. - Remove subtraction of UUIDs in GC bucket For the purpose to find leaked UUIDs, subtracting UUIDs in GC bucket is correct. However, it does no harm to remove blocks in GC bucket because they are already deleted from users' point of view. To remove subtraction, correctly tracked (not leaked) UUIDs may be included in the result, but we can reduce execution time of the script by skipping GC bucket scan. - Use ETS folding to output to file - Add options for specify buckets and skip unnecessary operations for efficiency - Use getopt and lager
{ok, Pid} -> | ||
pong = riakc_pb_socket:ping(Pid), | ||
audit(Pid, Options), | ||
timer:sleep(100); |
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.
What is this sleep for?
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 may be old/historical workaround now. R15B01 (too old one 😅 ) fixed standard out flush issue when escript exits [1].
There is (small) possibility to backport this script to CS 1.5 env, so if you don't mind, I want to
leave this line as is. Thoughts?
[1] OTP-9985 http://www.erlang.org/download/otp_src_R15B01.readme
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.
np. Let's leave as it is.
Code is perfect, tests passed - while some riak_tests around upgrade/downgrade still failing, but that'd be another issue. Well done, man. |
Thanks for review 😄 Addressed the comments and pushed ⏫ |
Orphan block scanner scripts [2.1] Reviewed-by: kuenishi
@borshop merge |
Rebased version of #1128 for some reason.
Steps for scanning orphan blocks
moss.buckets
<<0b:...>>
bucket{UUID, [list of existing block seqs]}
<<0o:...>>
bucket (by streamingcsbucketfold
)results of list keys
This is because list keys (or csbucketfold) of manifest buckets will
be done by R=1, then replica deficit (e.g. by force-replace) leads to
false-positiveness for orphan block extraction at previous step.
R=quorum (or R=all) manifest GETs is needed to avoid false-positive.
Usage (for debugging)
This PR adds scripts for gathering block {UUID, Sequence}s to be deleted.
For actual deletion, we can re-using block cleaner script in #1124.
But there is still some interface (file format) discrepancy, subsequent
PR is needed.