Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix incorrect arg in call to get_primary_apl/3 by put FSM
Additionally, optimize the get and put FSMs to only compute a list of
up nodes when using sloppy quorums. The strict quorum code path uses
get_primary_apl/3 which already computes the list of up nodes
internally.
  • Loading branch information
jtuple committed Jun 25, 2013
commit cd83e152ac79721858631b0b6a3211a7687bd896
4 changes: 1 addition & 3 deletions src/riak_kv_get_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ prepare(timeout, StateData=#state{bkey=BKey={Bucket,_Key},
{stop, normal, StateData2};
_ ->
StatTracked = proplists:get_value(stat_tracked, BucketProps, false),
UpNodes = riak_core_node_watcher:nodes(riak_kv),
Preflist2 = case proplists:get_value(sloppy_quorum, Options, true) of
true ->
UpNodes = riak_core_node_watcher:nodes(riak_kv),
riak_core_apl:get_apl_ann(DocIdx, N, UpNodes);
false ->
%% TODO: Avoid 2nd call to node_watcher inside the
%% call to get_primary_apl/3.
riak_core_apl:get_primary_apl(DocIdx, N, riak_kv)
end,
new_state_timeout(validate, StateData#state{starttime=riak_core_util:moment(),
Expand Down
4 changes: 2 additions & 2 deletions src/riak_kv_put_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ prepare(timeout, StateData0 = #state{from = From, robj = RObj,
process_reply(Error, StateData0);
_ ->
StatTracked = proplists:get_value(stat_tracked, BucketProps, false),
UpNodes = riak_core_node_watcher:nodes(riak_kv),
Preflist2 = case proplists:get_value(sloppy_quorum, Options, true) of
true ->
UpNodes = riak_core_node_watcher:nodes(riak_kv),
riak_core_apl:get_apl_ann(DocIdx, N, UpNodes);
false ->
riak_core_apl:get_primary_apl(DocIdx, N, UpNodes)
riak_core_apl:get_primary_apl(DocIdx, N, riak_kv)
end,
%% Check if this node is in the preference list so it can coordinate
LocalPL = [IndexNode || {{_Index, Node} = IndexNode, _Type} <- Preflist2,
Expand Down