mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
Merge pull request #180 from basho/jd-you-come-at-mister-zero-you-best-not-miss
Errors in search results are acceptable with a mixed cluster
This commit is contained in:
commit
aa4882acea
@ -67,6 +67,7 @@
|
||||
httpc_read/3,
|
||||
httpc_write/4,
|
||||
install_on_absence/2,
|
||||
is_mixed_cluster/1,
|
||||
is_pingable/1,
|
||||
join/2,
|
||||
leave/1,
|
||||
@ -473,6 +474,11 @@ load_modules_on_nodes([Module | MoreModules], Nodes)
|
||||
is_pingable(Node) ->
|
||||
net_adm:ping(Node) =:= pong.
|
||||
|
||||
is_mixed_cluster(Nodes) ->
|
||||
%% If the nodes are bad, we don't care what version they are
|
||||
{Versions, _BadNodes} = rpc:multicall(Nodes, init, script_id, [], rt:config(rt_max_wait_time)),
|
||||
length(lists:usort(Versions)) > 1.
|
||||
|
||||
%% @private
|
||||
is_ready(Node) ->
|
||||
case rpc:call(Node, riak_core_ring_manager, get_raw_ring, []) of
|
||||
|
@ -337,7 +337,14 @@ check_search(?SPAM_BUCKET, Nodes) ->
|
||||
Count2 == Count],
|
||||
Expected = lists:usort(SearchResults),
|
||||
Actual = lists:usort(Results),
|
||||
?assertEqual(Expected, Actual),
|
||||
case {rt:is_mixed_cluster(Nodes), Expected == Actual} of
|
||||
{false, _} -> ?assertEqual(Expected, Actual);
|
||||
{true, false} ->
|
||||
lager:info(
|
||||
"[KNOWN ISSUE] Search returned inaccurate results; however, the cluster is in a mixed state"
|
||||
);
|
||||
_ -> ok %% this is the success case, no need to do anything else
|
||||
end,
|
||||
ok.
|
||||
|
||||
spawn_search_tester(Search=#search{buckets=Buckets}) ->
|
||||
|
Loading…
Reference in New Issue
Block a user