📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-7.17

简而言之,当Elasticsearch在计算新的集群状态更新时,如果集群状态被并发修改,就会出现此错误。这可能是由于多个线程同时尝试更新状态所致。要解决此问题,请确保在单个线程中执行集群状态更新,以避免并发问题。此外,请检查您使用的Elasticsearch版本中是否存在任何错误,因为这可能是一个已知问题。升级到新版本可能会有所帮助。最后,确保您的集群有足够的资源来处理负载,因为资源限制可能导致此类问题。

日志上下文 #

日志 “state was mutated while calculating new CS update” 的类名是 ZenDiscovery.java. 我们从Elasticsearch源代码中提取了以下内容,以便为那些寻求深入上下文的人提供参考:

try {  // state got changed locally (maybe because another master published to us)
 if (clusterStatePublicationEvent.getOldState() != this.committedState.get()) {
 throw new FailedToCommitClusterStateException("state was mutated while calculating new CS update");
 }  pendingStatesQueue.addPending(newState);  publishClusterState.publish(clusterStatePublicationEvent; electMaster.minimumMasterNodes(); ackListener);