I am using riak-solr for searching purpose.In cluster we have join 4 nodes.When I query on solr something like date_l:[x TO y], it gives inconsistent results every time. Sometime it returns 1200 count, If again I query, It return 1240 count.As I know, riak replicates all data on all nodes. Is their any solution that all nodes will be sync with updated data only? Is it related to riak configuration
1 Answers
First off, just to clarify, Riak does not store replicas of data on every node. The default number of copies (R value - http://docs.basho.com/riak/kv/2.1.4/developing/app-guide/replication-properties/) is 3. In your 4 node cluster it is possible that a value could be stored on 3 nodes.
As to your primary concern, if you are getting inconsistent results back from SOLR queries it probably indicates that the replicas are inconsistent for some some reason (the three copies of the data you are querying don't match due to some kind of error). Normally inconsistency will be repaired over time by Riak's Active Anti Entropy feature (AAE). How long this will take depends on how much data you have and the size of the inconsistency.
If the problem doesn't correct itself you need to look at the log files on the nodes to see what is going on.

- 1,001
- 6
- 11
-
2This answers the question, I'd just like to add that the inconsistency may not necessarily be in the replicas, but in the Solr indexes, which are local to every Riak node. From my experience, Solr is very sensitive to performance and especially disk/IO issues, look at solr.log to see if there are any indexing errors. I also won't rely on Solr search if you need consistency - if a node fails and you replace it with a new one, Solr indexes on the new node will remain way behind the KV data for a long time. – vempo Aug 30 '16 at 14:16
-
Vempo you are 100% correct, when I say replicas I generically mean the data and the indices. I should probably be more specific. – Craig Aug 30 '16 at 19:07