basho/riak_kv — pull request #767 by engelsanchez (2013-12-17 17:00:38+00:00)
Title: Fixed 2i queries in mixed clusters

* In a mixed 1.4.2 - 1.4.4+ cluster, terms are not passed back to a
query originating in a 1.4.2 node.
* In a mixed 1.3.2 - 1.4.X cluster, terms are passed back to the 1.3.2
if the query originated there.

A riak test will be made soon. In the meantime this is easy to verify from the command line. Make a mixed cluster with two nodes (dev1=1.4.2, dev2=1.4.4). Create a range of items:

```bash
for n in {a..z}; do
curl -X POST -H "x-riak-index-b_bin: $n" -d"$n" http://localhost:10018/buckets/b/keys/k$n
done
```

And query either node requesting terms to be returned from both nodes with and without the fix:

```bash
curl -v http://localhost:10018/buckets/b/index/b_bin/a/f?return_terms=true
curl -v http://localhost:10028/buckets/b/index/b_bin/a/f?return_terms=true
```

Now a different cluster (dev1=1.3.2, dev2=1.4.4), populate the same way:

```bash
for n in {a..z}; do
curl -X POST -H "x-riak-index-b_bin: $n" -d"$n" http://localhost:10018/buckets/b/keys/k$n
done
```

And do a range query on both nodes(return terms is not understood by the 1.3 node, so don't try that):

```bash
curl -v http://localhost:10018/buckets/b/index/b_bin/a/f
curl -v http://localhost:10028/buckets/b/index/b_bin/a/f
```