basho/riak_kv — pull request #587 by jtuple (2013-06-25 02:49:20+00:00)
Title: Fix incorrect arg in call to get_primary_apl/3 by put FSM

Fix incorrect arg in call to `riak_core_apl:get_primary_apl/3` by the 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.

Without this change, puts that attempt to use strict quorums (ie. disable sloppy quorums) always fail:

```erlang
> {ok, C} = riak:local_client().
> C:put(riak_object:new(<<"abc">>, <<"xyz">>, <<"123">>),
[{sloppy_quorum, false}]).
{error,all_nodes_down}
```

With this patch, things work as desired.

```erlang
> {ok, C} = riak:local_client().
> C:put(riak_object:new(<<"abc">>, <<"xyz">>, <<"123">>),
[{sloppy_quorum, false}]).
ok
```