basho/yokozuna — pull request #275 by rzezeski (2014-01-15 00:11:56+00:00)
Title: Fix handoff check in mixed cluster scenario

Perform the metadata check only when Yokozuna is enabled on both the local and remote node. Otherwise just return `true` and let KV perform handoff.

This addresses #258. See commit messages for more detail.

I tested with a modified `verify_handoff_mixed` test. Below is the diff.

```diff
diff --git a/tests/verify_handoff_mixed.erl b/tests/verify_handoff_mixed.erl
index c4a7441..b278574 100644
--- a/tests/verify_handoff_mixed.erl
+++ b/tests/verify_handoff_mixed.erl
@@ -54,11 +54,13 @@ confirm() ->
UpgradeVsn = proplists:get_value(upgrade_version,
riak_test_runner:metadata(),
previous),
- SearchEnabled = [{riak_search, [{enabled, true}]}],
- Versions = [{current, SearchEnabled},
- {UpgradeVsn, SearchEnabled}],
+ RSEnabled = [{riak_search, [{enabled, true}]}],
+ YZEnabled = [{yokozuna, [{enabled, true}]}],
+ Versions = [{current, RSEnabled ++ YZEnabled},
+ {UpgradeVsn, RSEnabled}],
Services = [riak_kv, riak_search, riak_pipe],
[Current, Old] = Nodes = rt:deploy_nodes(Versions, Services),
+ rt:wait_for_service(Current, yokozuna),

prepare_vnodes(Current),

@@ -122,7 +124,7 @@ prepare_search_vnodes(Node) ->
[ list_to_binary(integer_to_list(N))
|| N <- lists:seq(1000, 1000+?SEARCH_COUNT) ]),
riakc_pb_socket:stop(C).
-
+
prepare_pipe_vnodes(Node) ->
%% the riak_pipe_w_pass worker produces no archive, but the vnode
%% still sends its queue (even if empty) through handoff
```