I have been having some problem with a failing test (using the
ElasticsearchIntegrationTest) that was testing scrolling.
It took quite a while to notice that in my response was an indication I was
getting a shard failure (my search response was OK, but the response
included shard failures).
I strongly suspect this is why I am not getting the results I expect from
the scroll (ie no results, totalHits=0)
When I dump the search response, I get a bit of a cryptic (at least for me)
message and I can't figure out what the cause is:
e.g.
I would have expected this error to manifest itself in the form of an
exception (java api) rather than having to inspect shard failures manually
(given the impact on the results).
I have seen all shards fail, but still no error reported. Is this expected?
How can I get a full stack trace of the error related to the shard
failure? "nested: AssertionError;" is teasing me with the fact that there is more info, but its being kept from me.
With a bit of cunning use of the debugger, I managed to get the stacktrace
that was lost.
It appears that maybe the ElasticsearchIntegrationTest environment is the
cause...
This looks like a bug?
java.lang.AssertionError
at org.elasticsearch.common.util.BigArrays$LongArrayWrapper.get(BigArrays.
java:200)
at org.elasticsearch.test.cache.recycler.MockBigArrays$LongArrayWrapper.get
(MockBigArrays.java:374)
at org.elasticsearch.common.util.BytesRefHash.get(BytesRefHash.java:66)
at org.elasticsearch.common.util.BytesRefHash.set(BytesRefHash.java:101)
at org.elasticsearch.common.util.BytesRefHash.add(BytesRefHash.java:145)
at org.elasticsearch.search.aggregations.bucket.terms.
StringTermsAggregator$WithOrdinals.collect(StringTermsAggregator.java:299)
at org.elasticsearch.search.aggregations.
AggregationPhase$AggregationsCollector.collect(AggregationPhase.java:164)
at org.elasticsearch.common.lucene.MultiCollector.collect(MultiCollector.
java:60)
at org.apache.lucene.search.Scorer.score(Scorer.java:65)
at org.apache.lucene.search.AssertingScorer.score(AssertingScorer.java:136)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:621)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(
ContextIndexSearcher.java:173)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.
java:282)
at org.elasticsearch.search.action.SearchServiceTransportAction.
sendExecuteQuery(SearchServiceTransportAction.java:270)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction.executeQueryPhase(
TransportSearchScrollQueryThenFetchAction.java:200)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction.access$600(
TransportSearchScrollQueryThenFetchAction.java:75)
at org.elasticsearch.action.search.type.
TransportSearchScrollQueryThenFetchAction$AsyncAction$2.run(
TransportSearchScrollQueryThenFetchAction.java:184)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:908)
at java.lang.Thread.run(Thread.java:662)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.