Skip to content

Commit

Permalink
Modified for fixing leo-project/leofs/issues/474
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed Apr 16, 2016
1 parent 73b79d2 commit aecd02c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/leo_storage_mq.erl
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,30 @@ recover_node_callback_1(_,_,_,[]) ->
recover_node_callback_1(AddrId, Key, Node, RedundantNodes) ->
case lists:member(Node, RedundantNodes) of
true ->
case lists:member(erlang:node(), RedundantNodes) of
true ->
?MODULE:publish(?QUEUE_ID_PER_OBJECT,
AddrId, Key, ?ERR_TYPE_RECOVER_DATA);
false ->
ok
case lists:delete(Node, RedundantNodes) of
[] ->
ok;
RedundantNodes_1 ->
recover_node_callback_2(RedundantNodes_1, AddrId, Key)
end;
false ->
ok
end.

%% @private
recover_node_callback_2([],_AddrId,_Key) ->
ok;
recover_node_callback_2([Node|Rest], AddrId, Key) ->
case leo_misc:node_existence(Node, ?DEF_REQ_TIMEOUT) of
true when Node == erlang:node() ->
?MODULE:publish(?QUEUE_ID_PER_OBJECT,
AddrId, Key, ?ERR_TYPE_RECOVER_DATA);
true ->
ok;
false ->
recover_node_callback_2(Rest, AddrId, Key)
end.


%% @doc synchronize by vnode-id.
%%
Expand Down

0 comments on commit aecd02c

Please sign in to comment.