Hi everybody,
I am using elasticsearch as a search cache which means that I am constantly
inserting/expiring/searching documents in one index (in parallel). Normally
this works fine, but on heavy loads (many updates / second) some errors
start appearing in a non-deterministic way. I tried to create a python
script to reproduce this error but I couldn't reproduce outside my
application.
This is the first error:
[27/07/12 05:06:07] WARN indexer.ElasticSearchIndexer: Could not
search - Failed to execute phase [query_fetch], total failure;
shardFailures {[na][posts][0]: No active shards}
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [query_fetch], total failure; shardFaiures {[na][posts][0]:
No active shards}
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:259)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(TransportSearchTypeAction.java:144)
at
org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction.doExecute(TransportSearchQueryAndFetchAction.java:56)
at
org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction.doExecute(TransportSearchQueryAndFetchAction.java:46)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:112)
at
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:43)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:83)
at
org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:206)
at
org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:743)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:53)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:47)
Sometimes I get this one too (the query is correct, and it works in
different occasions):
[27/07/12 05:06:08] WARN indexer.ElasticSearchIndexer: Could not
search - Failed to execute phase [query_fetch], total failure;
shardFailures {[ST_pdB1fS3aeJYU1NfiKIQ][posts][0]:
SearchParseException[[posts][0]:
query[content:casamento],from[0],size[1000]: Parse Failure [Failed to parse
source
[{"from":0,"size":1000,"query":{"query_string":{"query":"(word)","default_field":"content","default_operator":"and","analyzer":"standard","allow_leading_wildcard":false,"phrase_slop":0}},"filter":{"numeric_range":{"uploadDate":{"from":1343418749000,"to":null,"include_lower":true,"include_upper":true}}},>>"explain":true,"sort":[{"uploadDate":{"order":"asc"}}]}]]];
nested: QueryParsingException[[posts] failed to find mapping for field
[uploadDate]]; }
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed
to execute phase [query_fetch], total failure; shardFail>>ures
{[ST_pdB1fS3aeJYU1NfiKIQ][posts][0]: SearchParseException[[posts][0]:
query[content:casamento],from[0],size[1000]: Pars>>e Failure [Failed to
parse source [{"from":0,"size":1000,"query":{"query_string":{"query":
"(word)","default_field":"con>>tent","default_operator":"and","analyzer":"standard","allow_leading_wildcard":false,"phrase_slop":0}},"filter":{"numeric_range":{"uploadDate":{"from":1343418749000,"to":null,"include_lower":true,"include_upper":true}}},"explain":true,"sort":[{"uplo>>adDate":{"order":"asc"}}]}]]];
nested: QueryParsingException[[posts] failed to find mapping for field
[uploadDate]]; }
-
The shard is running. It was created with the java lib in the following
way:
node = NodeBuilder.nodeBuilder().node();
client = this.node.client(); -
Some searches are correctly returned while others return this
shardFailure error -
Tested with elasticsearch 0.17.7 and 0.19.8
Any clues?
Thanks in advance
Thiago