question

dmngaya avatar image
dmngaya asked Erick Ramirez answered

Why does Solr facet query return results but not CQL or Solr queries?

Hi all, My CQL query doesn't find row that i don't expect it to actually exist. This is the same if i try to use a SOLR query to try and retrieve the row contents (getting no row , it is normal). However, if i use a facet query looking for one of the fields row the row, i get back inconsistent results. At roughly once or twice out of 10 tries with the facet query i get back rows existing.

Although Apache Cassandra has consistent data across nodes, with repairs and reindexing correctly run, the data in Apache Solr with facet query is observed to be inconsistent. Below the facet query:

select scan from key.test where solr_query='{"fq":"testtype:DEVID AND model:HEAT AND readingtype:TR","q":"payloadtype:RECORDED AND testnumber:1007 AND reading:145 AND scan:15863","facet":{"field":"scan","mincount":1,"offset":0,"limit":10000,"sort":"reading asc"}}';

The question is why does the SOLR facet query find row counts while the CQL and SOLR queries return nothing ?

My dse version is 5.1.18.

Thank you for your help.

dsesearch
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

steve.lacerda avatar image
steve.lacerda answered

Hi, one thing that I have seen is that repairs are run, but the repair is run after an incremental repair was run previously. For instance, you can look in cfstats for something like this:

nodetool cfstats <keyspace>.<table>

And there should be a field called:

Percent repaired: 0.0

If that is great than 0.0, then you should run:

nodetool mark_unrepaired <keyspace> <table>

Then rerun your repair with:

nodetool repair -full

Another alternative explanation I'm thinking about, is the data being deleted while you're querying it? Is that a possibility?

Additionally, what could be happening if there are a lot of deletes is that you could be hitting the max deletion threshold, which defaults to 5 minutes. Solr completes these deletes in batches as well, so you can increase the batch size:

dse.yaml
fixed_rate_period: 60
max_docs_per_batch: 8192

Above, you'd be reducing the delete time to 60s and the batch size to 8192.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

This issue is a little beyond a Q&A forum and requires support assistance so please log a ticket with DataStax Support. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.