I use a simple secondary index query in Riak, traversing the keys in a bucket:
http://riak01:8098/buckets/my_bucket/index/$bucket/_?max_results=10
There are 10 keys in the result, as expected, such. However, when I use some of these keys in a KV query, Riak doesn't find the item. This is not caused by this particular key just being removed by another process, if I repeat (both index and KV query) in an hour, the results are the same.
What might be the reason for such behavior? Is there a way to make sure the secondary index is always consistent with the actual bucket contents, i.e. it 2i query returns the key if and only if an item with such key exists in a bucket?