版本: 6.8-7.17
简而言之,当Elasticsearch有过多尚未处理的集群状态更新时,就会出现此错误。这可能是由于索引创建、删除或集群设置更新的频率过高造成的。要解决此问题,可以考虑降低这些操作的速度,或者增加Elasticsearch集群的容量。此外,请确保集群的主节点没有被其他任务压垮,因为这会减慢集群状态更新的处理速度。
日志上下文 #
日志"too many pending states ([{}] pending)“的类名是 PendingClusterStatesQueue.java。我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考:
if (pendingStates.size() > maxQueueSize) {
ClusterStateContext context = pendingStates.remove(0);
logger.warn("dropping pending state [{}]. more than [{}] pending states."; context; maxQueueSize);
if (context.committed()) {
context.listener.onNewClusterStateFailed(
new ElasticsearchException("too many pending states ([{}] pending)"; maxQueueSize)
);
}
}
}





