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

Offline delete execution after orphan block scan #1145

Merged
merged 7 commits into from
May 12, 2015

Conversation

shino
Copy link
Contributor

@shino shino commented May 11, 2015

  • Refactor select_gc_bucket and offline_delete scripts to calculate vnode IDs
    in offline_delete side
  • Use offline_delete for output files from block_audit and ensure_orphan_blocks
  • Add test for select_gc_bucket
  • Misc refactoring

@shino shino added this to the 2.1.0 milestone May 11, 2015
@shino shino changed the title Offline delete execution test after orphan block scan Offline delete execution after orphan block scan May 11, 2015
@@ -149,23 +146,19 @@ handle_manifest({_UUID,
#state{threshold=Threshold} = _State)
when ContentLength < Threshold ->
{0, 0};
handle_manifest({_UUID, ?MANIFEST{bkey=BKey={Bucket,_},
handle_manifest({_UUID, ?MANIFEST{bkey=BKey={Bucket, Key},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend using CSBucket and CSKey as this will be confusing (originally I wrote this, sorry!)

@kuenishi
Copy link
Contributor

If you can fix nitpicks above today, I'll wait .

@kuenishi
Copy link
Contributor

... wait +1ing.

@shino
Copy link
Contributor Author

shino commented May 12, 2015

I pushed the update, master.

@kuenishi
Copy link
Contributor

Output of manual test said:

$ riak_cs/rel/riak-cs/bin/riak-cs escript ~/cs-2.1/riak_cs/priv/tools/internal/block_audit.erl -h localhost -o /tmp/select_gc.txt         
15:09:56.477 [info] Application lager started on node nonode@nohost
15:09:56.512 [info] Retrieved bucket list. There are 1 buckets, including tombstones.
15:09:56.512 [info] Searching for orphaned blocks. This may take a while...
15:09:56.512 [info] Finding Orphaned blocks for Bucket "test"
15:09:56.537 [info] Logged 2465 block keys to test
15:09:56.736 [info] handle_manifest_fold done for bucket: "test"

I thought the code

    info("Total number of UUIDs that has any orphaned blocks: ~p [count]", [UUIDs]),
    info("Total number of orphaned blocks: ~p [count]", [Blocks]),
    info("Orphaned Blocks written to ~p", [filename:absname(Filename)]).

shows the file to use next, but it didn't appear. Any idea what was wrong?

@kuenishi
Copy link
Contributor

I just removed whole data in LevelDB.

@kuenishi
Copy link
Contributor

Ah, that's because I deleted bucket record. mmmm.....

@kuenishi
Copy link
Contributor

fmm, failing again

$ riak_ee/rel/riak/bin/riak escript ~/cs-2.1/riak_cs/priv/tools/internal/offline_delete.erl  -r 8 --dry-run ~/cs-2.1/riak_ee/rel/riak/data/bitcask /tmp/select2_gc.txt/test
[Warning]
Make sure any Riak process using '/Users/kuenishi/cs-2.1/riak_ee/rel/riak/data/bitcask' is not running or your data may corrupt.
Accept the terms of conditions? [y/N] y
64 bitcask directories at /Users/kuenishi/cs-2.1/riak_ee/rel/riak/data/bitcask opened.
Using bitcask key version: 1.
escript: exception error: no function clause matching mochihex:dehex(116) (src/mochihex.erl, line 32)
  in function  mochihex:to_bin/2 (src/mochihex.erl, line 61)
  in call from offline_delete:for_each_line/6 (/Users/kuenishi/cs-2.1/riak_cs/priv/tools/internal/offline_delete.erl, line 133)
  in call from offline_delete:offline_delete/3 (/Users/kuenishi/cs-2.1/riak_cs/priv/tools/internal/offline_delete.erl, line 108)
  in call from escript:run/2 (escript.erl, line 747)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1 
  in call from init:start_em/1 

(??)

@kuenishi
Copy link
Contributor

oh, I need to run ensure script before.

@kuenishi
Copy link
Contributor

Hey @borshop

kuenishi added a commit that referenced this pull request May 12, 2015
…lean

Offline delete execution after orphan block scan
@kuenishi kuenishi merged commit e0199af into develop May 12, 2015
@kuenishi kuenishi deleted the feature/orphan-block-to-offline-clean branch May 12, 2015 07:47
@kuenishi
Copy link
Contributor

Merging as @borshop is temporarily unavailable, manually tested at laptop.

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

2 participants