Commits

Anonymous committed 13de518

no more filtered preflist

Comments (0)

Files changed (4)

src/riak_get_fsm.erl

     BucketProps = riak_bucket:get_bucket(Bucket, Ring),
     N = proplists:get_value(n_val,BucketProps),
     AllowMult = proplists:get_value(allow_mult,BucketProps),
-    Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
+    Preflist = riak_ring:preflist(DocIdx, Ring),
     {Targets, Fallbacks} = lists:split(N, Preflist),
     {Sent1, Pangs1} = riak_util:try_cast(vnode_get, Msg, nodes(), Targets),
     Sent = case length(Sent1) =:= N of   % Sent is [{Index,TargetNode,SentNode}]

src/riak_map_executor.erl

                         {link, LB, LT, LAcc} -> {map, LinkFun, {LB, LT}, LAcc}
                     end,
             N = proplists:get_value(n_val,BucketProps),
-            Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
+            Preflist = riak_ring:preflist(DocIdx, Ring),
             {Targets, _} = lists:split(N, Preflist),
             VNodes = try_vnode(QTerm, {Bucket,Key}, KeyData, Targets),
             {ok,wait,

src/riak_put_fsm.erl

     DocIdx = riak_util:chash_key({Bucket, Key}),
     Msg = {self(), {Bucket,Key}, RObj, ReqId, RealStartTime},
     N = proplists:get_value(n_val,BucketProps),
-    Preflist = riak_ring:filtered_preflist(DocIdx, Ring, N),
+    Preflist = riak_ring:preflist(DocIdx, Ring),
     {Targets, Fallbacks} = lists:split(N, Preflist),
     {Sent1, Pangs1} = riak_util:try_cast(vnode_put, Msg, nodes(), Targets),
     Sent = case length(Sent1) =:= N of   % Sent is [{Index,TargetNode,SentNode}]

src/riak_ring.erl

     ?assertEqual(x,index_owner(Ring1,0)),
     ?assertEqual(lists:sort([x,node()]),lists:sort(diff_nodes(Ring0,Ring1))).
 
-preflist_test() ->
-    IB = 274031556999544297163190906134303066185487351808,
-    IC = 1004782375664995756265033322492444576013453623296,
-    R = transfer_node(IB,b,transfer_node(IC,c,fresh(16,a))),
-    {FirstFour,_} = lists:split(4,[N || {_I,N} <- 
-                                     preflist(chash:key_of(0),R)]),
-    ?assertEqual([a,a,b,c],lists:sort(FirstFour)).
-
 reconcile_test() ->
     Ring0 = fresh(2,node()),
     Ring1 = transfer_node(0,x,Ring0),
                             merge_meta(Ring2#chstate.meta,
                                        Ring1#chstate.meta)})).
 
-full_preflist_test() ->
-    Ring0 = fresh(4,a),
-    I = 365375409332725729550921208179070754913983135744,
-    Ring = transfer_node(I,b,Ring0),
-    ?assertEqual(preflist(chash:key_of(zzzzzzzzz),Ring),
-                 preflist(chash:key_of(zzzzzzzzz),Ring)).
-