Skip to content

Instantly share code, notes, and snippets.

View bsparrow435's full-sized avatar

Brian Sparrow bsparrow435

View GitHub Profile

Step 1: From you logs I have decoded the bucket/key

binary_to_term(<<131,109,0,0,0,9,85,114,108,84,111,83,99,97,110>>).
<<"UrlToScan">>
binary_to_term(<<131,109,0,0,0,61,104,116,116,112,37,51,97,37,50,102,37,50,102,119,119,119,46,97,110,104,114,105,46,110,101,116,37,50,102,37,51,102,102,101,101,100,37,51,100,114,115,115,50,37,50,54,97,109,112,37,51,98,112,37,51,100,55,51,49,49,48>>).
<<"http%3a%2f%2fwww.anhri.net%2f%3ffeed%3drss2%26amp%3bp%3d73110">>

Step 2: Please run the below snippits from riak attach to identify the owning partitions of this bucket/key

f().
Vnode = fun(Idx) ->
[{I,P}] = [ {Index,Pid} || {Mod,Index,Pid} <- gen_server:call(riak_core_vnode_manager,all_vnodes),Mod == riak_kv_vnode, Index == Idx],
{I,P}
end,
Vnodes = fun() ->
[ I || {Mod,I,P} <- gen_server:call(riak_core_vnode_manager,all_vnodes), Mod == riak_kv_vnode ]
end,
-module(extract_bitcask).
main([Dir, Output]) ->
{ok, Fh} = file:open(Output,[write]),
io:format("Dumping bucket/keys for partition: ~p to output file: ~p\n", [Dir,Output]),
F = fun(Entry, _Acc) ->
case Entry of
{bitcask_entry, Key, _S, _T, _F, _U} ->
{B, K} = binary_to_term(Key),
erlang:put(extraction_counter, erlang:get(extraction_counter) + 1) ,
#!/usr/bin/env escript
%% -*- erlang -*-
-include_lib("kernel/include/file.hrl").
-compile(export_all).
-define(LOG(S), io:format(S)).
-define(LOG(S,A), io:format(S,A)).
main(Dirs) ->
CodePath = case os:getenv("RIAK_LIB") of
REPO ?= riak
.PHONY: rel stagedevrel deps
all: deps compile
compile:
./rebar compile
deps:
@bsparrow435
bsparrow435 / gist:3558713
Created August 31, 2012 20:42
Configuration Tweaks

#Add to vm.args

## Increase number of concurrent ports/sockets
-env ERL_MAX_PORTS 65536

## Use more Erlang processes (128K rather than default of 64K)
+P 131072

## Use a larger distributed erlang message buffer size to avoid (most) disterl busy port issues
[root@d-kvs-01 riak]# riak version 
Attempting to restart script through sudo -H -u riak 
riak-ee (1.2.0-92bc3fa0 2012-08-27) RedHat x86_64 
[root@d-kvs-01 ~]# riak-admin cluster leave 
Attempting to restart script through sudo -H -u riak 
Success: staged leave request for 'kvs@d-kvs-01.tradecard.com' 
[root@d-kvs-01 ~]# riak-admin cluster plan 
Attempting to restart script through sudo -H -u riak 
=============================== Staged Changes ================================ 
```
2012-08-30 22:04:01.135 [info] <0.22219.0>@riak_core_handoff_sender:start_fold:126 Starting ownership_handoff transfer of riak_kv_vnode from 'kvs@d-kvs-01.tradecard.com' 11417981541647679048466287755595961091061972992 to 'kvs@d-kvs-03.tradecard.com' 11417981541647679048466287755595961091061972992
2012-08-30 22:04:03.658 [info] <0.198.0>@riak_core_handoff_manager:handle_info:271 An outbound handoff of partition riak_kv_vnode 0 was terminated for reason: {shutdown,max_concurrency}
2012-08-30 22:04:10.079 [info] <0.22254.0>@riak_core_handoff_sender:start_fold:126 Starting ownership_handoff transfer of riak_kv_vnode from 'kvs@d-kvs-01.tradecard.com' 0 to 'kvs@d-kvs-02.tradecard.com' 0
2012-08-30 22:04:32.449 [error] <0.1729.0> gen_fsm <0.1729.0> in state active terminated with reason: {timeout,{gen_server,call,[riak_core_handoff_manager,{add_outbound,riak_kv_vnode,11417981541647679048466287755595961091061972992,'kvs@d-kvs-03.tradecard.com',<0.1729.0>}]}}
2012-08-30 22:04:36.755 [error] <0.1729.0> CRASH REPORT


2012-08-24 00:24:20.747 [error] emulator Error in process <0.24573.185> on node 'riak@10.1.46.45' with exit value: {badarg,[{erlang,binary_to_term,[<<30438 bytes>>],[]},{mi_segment,iterate_all_bytes,2,[{file,"src/mi_segment.erl"},{line,164}]},{mi_server,'-group_iterator/2-fun-1-',2,[{file,"src/mi_server.erl"},{line,723}]},{mi_server,'-group_iterator/2-fun-0-'... 


2012-08-24 00:24:20.747 [error] <0.1057.0>@mi_scheduler:worker_loop:141 Failed to compact <0.4184.0>: {badarg,[{erlang,binary_to_term,[<<131,109,0,0,246,224,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,6

`2012-08-24 00:24:20.747 [error] emulator Error in process <0.24573.185> on node 'riak@10.1.46.45' with exit value: {badarg,[{erlang,binary_to_term,[<<30438 bytes>>],[]},{mi_segment,iterate_all_bytes,2,[{file,"src/mi_segment.erl"},{line,164}]},{mi_server,'-group_iterator/2-fun-1-',2,[{file,"src/mi_server.erl"},{line,723}]},{mi_server,'-group_iterator/2-fun-0-'...

2012-08-24 00:24:20.747 [error] <0.1057.0>@mi_scheduler:worker_loop:141 Failed to compact <0.4184.0>: {badarg,[{erlang,binary_to_term,[<<131,109,0,0,246,224,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,