版本: 7.8-8.9
简而言之,当Elasticsearch在scroll操作的搜索阶段遇到问题时,就会发生此错误。这可能是由于多种原因造成的,例如超时、内存问题或查询存在问题。要解决此问题,可以增加超时时间、为Elasticsearch分配更多内存,或检查查询是否存在错误。此外,请确保Elasticsearch集群健康且未承受重负载。如果问题仍然存在,可以考虑将查询分解为更小的部分或使用分页代替scroll。
日志上下文 #
日志"[{}] search failed due to SearchPhaseExecutionException. Will attempt again with new scroll"的类名是 ScrollDataExtractor.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:
searchResponse = executeSearchScrollRequest(scrollId);
} catch (SearchPhaseExecutionException searchExecutionException) {
if (searchHasShardFailure) {
throw searchExecutionException;
}
logger.debug("[{}] search failed due to SearchPhaseExecutionException. Will attempt again with new scroll"; context.jobId);
markScrollAsErrored();
searchResponse = executeSearchRequest(buildSearchRequest(lastTimestamp == null ? context.start : lastTimestamp));
}
logger.debug("[{}] Search response was obtained"; context.jobId);
timingStatsReporter.reportSearchDuration(searchResponse.getTook());





