I’ve been using the couchbase api 2.1.4 library and been running into an issue related to incorrect data.
In the code, I’m using the non-blocking pattern (rxJava) + Twitter Future.
Fetch a set of data for a set of keys
-subscribe to the results and once completed set the twitter promise.
-Compare the request keys and the result keys and the keys are different. The result appears to be from a different request.
For every ~150k queries, we find one request would hit the scenario above and so it’s very rare.
Any suggestions or help would be great.
A few data points:
-The bucket is shared between all threads
-The env and cluster was created once
-Couchbase Server 3.0.1
batchGet(keyMapping.keys, keySpace).map { seq =>
seq.map { jsonDoc =>
(keyMapping.get(jsonDoc.id()).getOrElse {
val msg = "missing key: " + jsonDoc.id() + ". available keys: " + keyMapping.keySet
logger.warning(msg) //We're find examples where the keys doesn't match the request in the log
throw new CacheResultMisMatchException(msg)
} ->
(parseDoc(jsonDoc), jsonDoc))
}.toMap
}
All our data types are immutable other than the twitter promise. The keyMapping.keys are used to fetch the items from Couchbase but we found results from Couchbase where the id wasn’t in the set of keys that was requested. In the logs, it clearly shows it is unrelated (and not a mismatch in casing or spacing).
I see, nothing stands out of the scala code…
could you raise a bug in the Couchbase Jira with this code sample and the rough frequency at which you observed mismatches, so that we can track and investigate?