Francisco,

I'm not sure how it happend, but perhaps the file was updated at some point
and the root became a pointer to an empty tree.  If you didn't already know
Luwak keeps all old versions of your file around, but it doesn't really
have any APIs for accessing it.  Try attaching to the Riak console and run
the following:


{ok, C} = riak:local_client().
{ok, F} = luwak_file:get(C, <<"filename">>).
PrevRoot = hd(luwak_file:get_property(F, ancestors)).
V = riak_object:get_value(F).
V2 = lists:keyreplace(root, 1, V, {root, PrevRoot}).
TempF = riak_object:apply_updates(riak_object:update_value(F, V2)).
Bytes = luwak_io:get_range(C, TempF, 0, Length). % where Length is number
of bytes you want to read

I also made a gist of the above: https://gist.github.com/1602953

If the first ancestor doesn't give you anything then keep moving down the
list.  Otherwise, if you do find the data you are looking for let me know
and we'll see if we can't get your file object fixed.

-Ryan

On Thu, Jan 12, 2012 at 2:12 PM, francisco treacy <
francisco.tre...@gmail.com> wrote:

> Hi Kelly,
>
> Yes, I had removed a node from the cluster and then forced
> read-repair. I think it was you actually help me out a couple of
> months ago with this.
>
> So far we didn't run into any other broken assets, but we need to get
> these up. Ideas?
>
> Thanks,
>
> Francisco
>
> 2012/1/12 Kelly McLaughlin <ke...@basho.com>:
> > Francisco,
> >
> > Is it the case that you have already tried to force read repair on the
> file chunks and are still seeing these errors?
> >
> > Kelly
> >
> > On Jan 12, 2012, at 10:57 AM, francisco treacy wrote:
> >
> >> Hi,
> >>
> >> One of my users is preparing an exam but can't load an image because
> >> Luwak is serving it broken (i.e. responds with HTTP 200; 0 bytes)
> >>
> >> Visibly caused by a non-existing chunk of that file on that partition.
> >> I would've expected read-repair to kick in and update the value. But
> >> it keeps on serving 0 bytes.
> >>
> >> Why is this happening and how can I fix it?
> >>
> >> Thanks,
> >>
> >> Francisco
> >>
> >>
> >> =CRASH REPORT==== 12-Jan-2012::18:42:29 ===
> >>  crasher:
> >>    initial call: luke_flow:init/1
> >>    pid: <0.16316.2941>
> >>    registered_name: []
> >>    exception exit:
> >>
> {error,{phase_error,{error,{throw,{function_clause,[{riak_object,get_value,[{error,notfound}]},{luwak_get_stream,-map_fun/0-fun-0-,3},{riak_kv_mapper,run_map,9},{riak_kv_mapper,-do_map/2-fun-0-,9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]},[{luwak_get_stream,-map_fun/0-fun-0-,3},{riak_kv_mapper,run_map,9},{riak_kv_mapper,-do_map/2-fun-0-,9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]}}}}
> >>      in function  gen_fsm:terminate/7
> >>      in call from proc_lib:init_p_do_apply/3
> >>    ancestors: [luke_flow_sup,luke_sup,<0.10483.536>]
> >>    messages: []
> >>    links: [<0.10485.536>]
> >>    dictionary: []
> >>    trap_exit: true
> >>    status: running
> >>    heap_size: 610
> >>    stack_size: 24
> >>    reductions: 258
> >>  neighbours:
> >>
> >> =SUPERVISOR REPORT==== 12-Jan-2012::18:42:29 ===
> >>     Supervisor: {local,luke_flow_sup}
> >>     Context:    child_terminated
> >>     Reason:
> >>
> {error,{phase_error,{error,{throw,{function_clause,[{riak_object,get_value,[{error,notfound}]},{luwak_get_stream,-map_fun/0-fun-0-,3},{riak_kv_mapper,run_map,9},{riak_kv_mapper,-do_map/2-fun-0-,9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]},[{luwak_get_stream,-map_fun/0-fun-0-,3},{riak_kv_mapper,run_map,9},{riak_kv_mapper,-do_map/2-fun-0-,9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]}}}}
> >>     Offender:
> >>
> [{pid,<0.16316.2941>},{name,undefined},{mfa,{luke_flow,start_link,[<10351.27714.2432>,18337056,[{riak_kv_map_phase,[],[{erlang,{map,{qfun,#Fun<luwak_get_stream.1.10025879>},{map,{riak_client,ri...@xx.165.253.xx
> ,<<[2,139,139,84]>>},1000000,#Ref<0.0.487.249801>,<0.16313.2941>,0,76134},false}}]}],undefined,66000]}},{restart_type,temporary},{shutdown,brutal_kill},{child_type,worker}]
> >>
> >> _______________________________________________
> >> riak-users mailing list
> >> riak-users@lists.basho.com
> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to