我有一个测试ElasticSearch框(2.3.0),我的测试使用ES失败的随机顺序,真是令人沮丧(失败,所有碎片失败异常)。ElasticSearch运行测试时随机失败
望着elastic_search.log
文件只给我看了这个
[2017-05-04 04:19:15,990][DEBUG][action.search.type ] [es-testing-1] All shards failed for phase: [query]
RemoteTransportException[[es-testing-1][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: IllegalIndexShardStateException[CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED, RELOCATED]];
Caused by: [derp_test][[derp_test][3]] IllegalIndexShardStateException[CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED, RELOCATED]]
at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:993)
at org.elasticsearch.index.shard.IndexShard.acquireSearcher(IndexShard.java:814)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:641)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:618)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:369)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:350)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
任何想法是怎么回事?到目前为止,我的研究只告诉我这很可能是由于腐败的超时日志 - 但我不认为删除超时日志将会有所帮助,因为测试将丢掉每个命名空间的测试索引
ES测试盒具有3.5GB RAM,使用2.5GB堆大小,CPU使用率是在测试过程中相当正常(15%达到峰值)
澄清:当我说失败测试,余与怪异异常意味着误差以上(未失败的测试如所提到的由于值不正确)。每次插入/更新操作后,我都进行了手动刷新,因此值是正确的。
活跃(https://www.elastic.co /guide/en/elasticsearch/reference/current/integration-tests.html)进行集成测试? – chengpohi
@chengpohi不,目前它只是把测试盒视为一个普通的es盒子。这是一个反模式还是什么? – GantengX