Re: {error, notfound} items in mapreduce during ownership handoff

2013-03-06 Thread John Daily
Disclaimer: I haven't done this myself, or even attempted to compile the code below, but in hopes it makes your life a little easier... Here's some Erlang that should allow you to abstract away the checks. Assuming that you have a function named "real_map_fun" that takes a single Riak object as

Re: {error, notfound} items in mapreduce during ownership handoff

2013-03-06 Thread Jeremy Raymond
Thanks for the response. To handle not founds and tombstones I need this in every map function? map_something({error, notfound}, _, _) -> []; map_something(RiakObj, _, _) -> Metadata = riak_object:get_metadata(RiakObj), case dict:is_key(<<"X-Riak-Deleted">>, Metadata) of true -

Re: {error, notfound} items in mapreduce during ownership handoff

2013-03-06 Thread John Daily
I'm sorry this went unanswered, Jeremy. Thanks for the follow up. Your code needs to be able to handle notfound errors and tombstones[1] regardless of ownership handoff. The coverage for the 2i or listkeys input will be calculated up front, with the work distributed to a node where the key is

Re: {error, notfound} items in mapreduce during ownership handoff

2013-03-06 Thread Jeremy Raymond
So I should expect {error, notfound} inputs to map jobs while ownership handoff is in progress? Are the not found items actually unavailable during handoff or is this just not found on the old node, but will be picked up by the new node during the same mapreduce job? -- Jeremy On Thu, Feb 28, 20

{error, notfound} items in mapreduce during ownership handoff

2013-02-28 Thread Jeremy Raymond
Yesterday I added a new node to my cluster. During the time when ownership handoff was happening (several hours of work) mapreduce map functions were receiving {error, notfound} as inputs. My Erlang mapred functions weren't designed to handle this. They hadn't encountered this before during normal