riak-erlang-client issue with Riak EE 1.2

Sean Cribbs sean at basho.com
Wed Aug 29 01:33:30 EDT 2012


Julian,

I might also add that those header files (like riak_search_pb.hrl) are
not checked in because they are generated when the .proto files are
compiled. It should be sufficient to add riakc as your rebar
dependency.

In the meantime we'll get those docs updated on Github pages.

On Tue, Aug 28, 2012 at 10:26 PM, Dave Parfitt <diparfitt at gmail.com> wrote:
> Hello Julian -
>
> Map-reduce is still available, it's just not what riakc_pb_socket:search/* uses under the hood anymore. Both map/reduce and Riak search functionality are implemented in the client using Protocol Buffers now.
>
> The Map/Reduce functions are available here:
> https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L454
>
> and the Search functions are available here:
> https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L618
>
> Cheers -
> Dave
>
> On Aug 28, 2012, at 3:06 PM, Julian wrote:
>
>> Hi Dave,
>>
>> I don't see documentation up on basho.github.com for client 1.3.0, and
>> I don't see some of those include files referenced from riak_pb (ex
>> riak_search_pb.hrl) in your repo, so I'll assume those are meant to be
>> internal. But how am I supposed to know how to migrate to the new
>> parameters? I was using mapreduce in the prior version to return
>> portions of the stored objects rather than the bucket/key. I was using
>> this anonymous js function:
>>
>> function(v, keyData, arg) {
>>    var o = JSON.parse(v.values[0].data);
>>    var p = {id:o.id, account_id:o.account_id,
>> account_type_id:o.account_type_id, deleted:o.deleted, status:o.status,
>> hidden:o.hidden, currency:o.currency};
>>    return [JSON.stringify(p)]
>> }
>>
>> On Fri, Aug 17, 2012 at 6:22 AM, Dave Parfitt <diparfitt at gmail.com> wrote:
>>>
>>> Hello Julian -
>>>
>>>  A new version of the riak-erlang-client [1] was recently released that changes riakc_pb_socket:search/* to use protobuffs instead of map/reduce. Give that a shot first and let us know if it works for you.
>>>
>>> Cheers -
>>> Dave
>>>
>>> [1] https://github.com/basho/riak-erlang-client/
>>>
>>>
>>> On Aug 16, 2012, at 6:51 PM, Julian wrote:
>>>
>>> Hi,
>>>
>>> Recently, we upgraded our Riak cluster to 1.2. I hear that one of our buckets has been wiped and reloaded, but our index (Riak search is enabled) may not be in a consistent state. This has led to an error in code using riak-erlang-client 1.2, shown below.
>>>
>>> One of the intriguing things I find is that the exception is listed as occuring in one of my own processes that is doing json decoding, however I have checked the json by saving it to a file and it does not contain the data shown inside the 'struct' in the exception. The only explanation I can come up with is that the badmatch is occurring within riakc_pb socket and was triggered by my call to riakc_pb_socket:search/6, and the process link is somehow influencing the crash report.
>>>
>>> 1. Is there a newer version of riak-erlang-client that might fix the issue? I noticed that though labeled v1.2, it came out in April; has there been a client code update for EE 1.2?
>>> 2. Would it help make my code more robust if I tried to filter out these not_found's so it wouldn't reach the client? As in http://lists.basho.com/pipermail/riak-users_lists.basho.com/2012-January/007075.html
>>>
>>>
>>> (module names edited slightly)
>>>
>>> =CRASH REPORT==== 16-Aug-2012::21:44:52 ===
>>>  crasher:
>>>    initial call: xx_acl_query:init/1
>>>    pid: <0.159.0>
>>>    registered_name: []
>>>    exception exit: {{badmatch,
>>>                         {not_found,
>>>                             {<<"a65796222ea26bb7b355bf140dbd5b72e81efee1">>,
>>>                              <<"000018e5-accf-fff1-8123-1efee1">>},
>>>                             {struct,
>>>                                 [{p,[0]},
>>>                                  {<<"account_id">>,[<<"0000005427">>]},
>>>                                  {<<"account_type_id">>,[<<"3">>]},
>>>                                  {<<"id">>,[<<"6373">>]},
>>>                                  {<<"status">>,[<<"Deleted">>]},
>>>                                  {<<"type">>,[<<"account">>]},
>>>                                  {score,[1.0]}]}}},
>>>                     [{mochijson2,tokenize,2},
>>>                      {mochijson2,decode1,2},
>>>                      {mochijson2,json_decode,2},
>>>                      {lists,map,2},
>>>                      {lists,map,2},
>>>                      {xx_acl_tree,from_json,2},
>>>                      {xx_acl_query,load_instance_,2},
>>>                      {xx_acl_query,bootstrap_accounts,1}]}
>>>      in function  gen_server:init_it/6
>>>    ancestors: [xx_cache_sup,xx_acl_sup,<0.108.0>]
>>>    messages: []
>>>    links: [<0.132.0>]
>>>    dictionary: [<omitted>]
>>>    trap_exit: true
>>>    status: running
>>>    heap_size: 832040
>>>    stack_size: 24
>>>    reductions: 30690459
>>>  neighbours:
>>>
>>>
>>> Cheers,
>>> Julian Pellico
>>> _______________________________________________
>>> riak-users mailing list
>>> riak-users at lists.basho.com
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>
>>>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



-- 
Sean Cribbs <sean at basho.com>
Software Engineer
Basho Technologies, Inc.
http://basho.com/




More information about the riak-users mailing list