Commits

Anonymous committed fe0d71b

Filter node annotations

Commit d3ccf9 in riak_core added annotations to the preflist which
vnode_master command doesn't take account for. For now the clients
will just have to filter out the annotations themselves but we should
look at making the preflist an opaque type to avoid stuff like this in
the future.

  • Participants
  • Parent commits cfbaa5e

Comments (0)

Files changed (1)

File apps/riak_search/src/riak_search_op_term.erl

     DocIdx = riak_search_ring_utils:calc_partition(Index, Field, Term),
     {ok, Schema} = riak_search_config:get_schema(Index),
     NVal = Schema:n_val(),
-    Preflist = riak_core_apl:get_primary_apl(DocIdx, NVal, riak_search),
+    Preflist = get_preflist(DocIdx, NVal),
 
     %% Try to use the local node if possible. Otherwise choose
     %% randomly.
     DocIdx = riak_search_ring_utils:calc_partition(Index, Field, Term),
     {ok, Schema} = riak_search_config:get_schema(Index),
     NVal = Schema:n_val(),
-    Preflist = riak_core_apl:get_primary_apl(DocIdx, NVal, riak_search),
+    Preflist = get_preflist(DocIdx, NVal),
     
     {ok, Ref} = riak_search_vnode:info(Preflist, Index, Field, Term, self()),
     {ok, Results} = riak_search_backend:collect_info_response(length(Preflist), Ref, []),
                         [Score]
                 end,
     lists:keystore(score, 1, Props, {score, ScoreList}).
+
+get_preflist(DocIdx, NVal) ->
+    [{Idx,Node}
+     || {{Idx,Node},primary} <- riak_core_apl:get_primary_apl(DocIdx,
+                                                              NVal,
+                                                              riak_search)].