Error while deleting a whole Bucket using Contrib Reducer

kiran kulkarni kk.questworld at gmail.com
Sat Jul 13 17:05:04 EDT 2013


Hello,

I need to delete buckets on production. I am using Riak 1.3.0. As Bucket
Operations<http://docs.basho.com/riak/1.2.1/references/apis/http/#Bucket-Operations>
doesn't
provide any API to delete bucket,  I was trying delete_keys reducer
available in contrib<https://github.com/basho/riak_function_contrib/blob/master/mapreduce/erlang/delete_keys.erl>directory

I populated a bucket "testing3" and populated it with 100 items
My MapReduce query looks like
{
  "inputs": "testing3",
  "query": [{"map": {"language": "javascript",
                     "source": "function(value, keydata, args){return
[[value.bucket, value.key]];}"}},

           {"reduce": {"language": "erlang",
                       "module": "delete_keys",
                       "function": "delete"}}],
  "timeout": 900000
}

I have also verified that "delete_keys" module is being included

(dev1 at 127.0.0.1)1> delete_keys:module_info().
[{exports,[{module_info,0},{module_info,1},{delete,2}]},
 {imports,[]},
 {attributes,[{vsn,[308055930713635303025382691973616137846]}]},
 {compile,[{options,[{outdir,"/Users/kiran/work/riak-work/mapred/erlang"}]},
           {version,"4.8.1"},
           {time,{2013,7,13,17,56,26}},

 {source,"/Users/kiran/work/riak-work/mapred/erlang/delete_keys.erl"}]}]

But It throws of following error I am quite clueless. Any help will be
appreciated

html><head><title>500 Internal Server
Error</title></head><body><h1>Internal Server Error</h1>The server
encountered an error while processing this request:<br><pre>{error,
    {error,
        {case_clause,
            {error,
                {1,
                 [{module,riak_kv_w_reduce},

{partition,433883298582611803841718934712646521460354973696},
                  {details,
                      [{fitting,
                           {fitting,<0.5892.0>,#Ref<0.0.0.33932>,
                               <<"K�������������������">>,1}},
                       {name,1},
                       {module,riak_kv_w_reduce},
                       {arg,{rct,#Fun<delete_keys.delete.2>,none}},
                       {output,
                           {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,
                               undefined}},
                       {options,
                           [{log,sink},
                            {trace,[error]},
                            {sink,
                                {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,
                                    undefined}},
                            {sink_type,{fsm,10,infinity}}]},
                       {q_limit,64}]},
                  {type,error},
                  {error,undef},
                  {input,[<<"testing3">>,<<"84">>]},
                  {modstate,
                      {state,[],
                          [[<<"testing3">>,<<"90">>],
                           [<<"testing3">>,<<"27">>],
                           [<<"testing3">>,<<"8">>],
                           [<<"testing3">>,<<"88">>],
                           [<<"testing3">>,<<"11">>],
                           [<<"testing3">>,<<"23">>],
                           [<<"testing3">>,<<"46">>],
                           [<<"testing3">>,<<"12">>],
                           [<<"testing3">>,<<"77">>],
                           [<<"testing3">>,<<"15">>],
                           [<<"testing3">>,<<"22">>],
                           [<<"testing3">>,<<"74">>],
                           [<<"testing3">>,<<"86">>],
                           [<<"testing3">>,<<"85">>],
                           [<<"testing3">>,<<"6">>],
                           [<<"testing3">>,<<"73">>],
                           [<<"testing3">>,<<"94">>],
                           [<<"testing3">>,<<"13">>],
                           [<<"testing3">>,<<"89">>]],
                          19,20,
                          433883298582611803841718934712646521460354973696,
                          {fitting_details,
                              {fitting,<0.5892.0>,#Ref<0.0.0.33932>,
                                  <<"K�������������������">>,1},
                              1,riak_kv_w_reduce,
                              {rct,#Fun<delete_keys.delete.2>,none},
                              {fitting,<0.5890.0>,#Ref<0.0.0.33932>,sink,
                                  undefined},
                              [{log,sink},
                               {trace,[error]},
                               {sink,
                                   {fitting,<0.5890.0>,#Ref<0.0.0.33932>,
                                       sink,undefined}},
                               {sink_type,{fsm,10,infinity}}],
                              64}}},
                  {stack,
                      [{delete_keys,delete,
                           [[[<<"testing3">>,<<"89">>],
                             [<<"testing3">>,<<"13">>],
                             [<<"testing3">>,<<"94">>],
                             [<<"testing3">>,<<"73">>],
                             [<<"testing3">>,<<"6">>],
                             [<<"testing3">>,<<"85">>],
                             [<<"testing3">>,<<"86">>],
                             [<<"testing3">>,<<"74">>],
                             [<<"testing3">>,<<"22">>],
                             [<<"testing3">>,<<"15">>],
                             [<<"testing3">>,<<"77">>],
                             [<<"testing3">>,<<"12">>],
                             [<<"testing3">>,<<"46">>],
                             [<<"testing3">>,<<"23">>],
                             [<<"testing3">>,<<"11">>],
                             [<<"testing3">>,<<"88">>],
                             [<<"testing3">>,<<"8">>],
                             [<<"testing3">>,<<"27">>],
                             [<<"testing3">>,<<"90">>],
                             [<<"testing3">>,<<"84">>]],
                            none],
                           []},
                       {riak_kv_w_reduce,reduce,3,
                           [{file,"src/riak_kv_w_reduce.erl"},{line,206}]},
                       {riak_kv_w_reduce,maybe_reduce,2,
                           [{file,"src/riak_kv_w_reduce.erl"},{line,157}]},
                       {riak_pipe_vnode_worker,process_input,3,
                           [{file,"src/riak_pipe_vnode_worker.erl"},
                            {line,444}]},
                       {riak_pipe_vnode_worker,wait_for_input,2,
                           [{file,"src/riak_pipe_vnode_worker.erl"},
                            {line,376}]},
                       {gen_fsm,handle_msg,7,
                           [{file,"gen_fsm.erl"},{line,494}]},
                       {proc_lib,init_p_do_apply,3,
                           [{file,"proc_lib.erl"},{line,227}]}]}]}}},
        [{riak_kv_wm_mapred,pipe_mapred_nonchunked,3,
             [{file,"src/riak_kv_wm_mapred.erl"},{line,180}]},
         {webmachine_resource,resource_call,3,
             [{file,"src/webmachine_resource.erl"},{line,183}]},
         {webmachine_resource,do,3,
             [{file,"src/webmachine_resource.erl"},{line,141}]},
         {webmachine_decision_core,resource_call,1,
             [{file,"src/webmachine_decision_core.erl"},{line,48}]},
         {webmachine_decision_core,decision,1,
             [{file,"src/webmachine_decision_core.erl"},{line,481}]},
         {webmachine_decision_core,handle_request,2,
             [{file,"src/webmachine_decision_core.erl"},{line,33}]},
         {webmachine_mochiweb,loop,1,
             [{file,"src/webmachine_mochiweb.erl"},{line,97}]},
         {mochiweb_http,parse_headers,5,
* Connection #0 to host 127.0.0.1 left intact

 [{file,"src/mochiweb_http.erl"},{line,180}]}]}}</pre><P><HR><ADDRESS>mochiweb+webmachine
web server</ADDRESS></body></html>* Closing connection #0
-- 
Kiran Kulkarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130714/95fead52/attachment.html>


More information about the riak-users mailing list