Riak mapreduce function map_object_value return empty result on erlang pb client

Bryan Fink bryan at basho.com
Mon Oct 15 11:55:41 EDT 2012

On Thu, Oct 11, 2012 at 1:32 AM, Mikhail Kuznetsov
<kuznetsov.m.yu at gmail.com> wrote:
> I use riak erlang client for my project, and update riak and client library
> today from master(client to 1.3.1 and server to 1.2.0). Everything works
> except fetching multiple entities with map-reduce return empty. Instead of
> usual result {ok, [...,{<stage_number>,<stage result>},...]} I get {ok,[]}.
> Rollback with client and everything works ok. But if I use old client with
> new riak I got a lot of errors in the server logs.

Hi, Mikhail. I'm not surprised by the old-client-with-new-riak errors.
The definitions of some protocol buffers changed in the 1.2.0 Riak
release, iirc.

As for the missing results, though, I've been unable to reproduce the
issue as you reported. Using Riak 1.2.0 and riak-erlang-client 1.3.1:

1> {ok, S} = riakc_pb_socket:start("", 8087).

2> BK = [{<<"mk">>,<<"1">>},{<<"mk">>,<<"2">>},{<<"mk">>,<<"3">>}].

3> [ riakc_pb_socket:put(S, riakc_obj:new(B, K, K)) || {B, K} <- BK ].

4> {ok, [{0,Result}]} = riakc_pb_socket:mapred(S, BK, [{map, {modfun,
riak_kv_mapreduce, map_object_value},undefined, true}]).

Can you see where my example differs from yours?


More information about the riak-users mailing list