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

版本: 6.8-8.9

简而言之,当 Elasticsearch 分片的恢复过程由于特定原因被中断或停止时,会出现此错误。这可能是由于节点离开集群、新的恢复过程启动或手动取消导致的。要解决此问题,您可以尝试重新启动恢复过程,确保集群的稳定性以防止节点意外离开,或检查可能导致取消的任何手动中断。

日志上下文 #

日志 “recovery was canceled reason [ " + reason + " ]” 的类名是 RecoverySourceHandler.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:

    cancellableThreads.setOnCancel((reason; beforeCancelEx) -> {
        final RuntimeException e;
        if (shard.state() == IndexShardState.CLOSED) { // check if the shard got closed on us
            e = new IndexShardClosedException(shard.shardId(); "shard is closed and recovery was canceled reason [" + reason + "]");
        } else {
            e = new CancellableThreads.ExecutionCancelledException("recovery was canceled reason [" + reason + "]");
        }
        if (beforeCancelEx != null) {
            e.addSuppressed(beforeCancelEx);
        }
        IOUtils.closeWhileHandlingException(releaseResources; () -> future.onFailure(e));