版本: 6.8-7.2
简要来说,当Elasticsearch在恢复过程中遇到损坏的文件时会出现此错误。这可能是由于硬件问题、系统突然关闭或软件错误导致的。要解决此问题,您可以尝试以下方法:1)重启Elasticsearch节点,这可能会触发新的恢复过程。2)从最近的备份恢复数据。3)如果损坏的分片是副本分片,您可以删除它并让Elasticsearch重新创建它。4)如果损坏严重,您可能需要重建整个索引。始终确保定期备份数据以防止数据丢失。
日志上下文 #
日志"File corruption occurred on recovery but"类名是 RecoverySourceHandler.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:
} catch (IOException ex) {
targetException.addSuppressed(ex);
throw targetException;
}
// corruption has happened on the way to replica
RemoteTransportException exception = new RemoteTransportException("File corruption occurred on recovery but " +
"checksums are ok"; null);
exception.addSuppressed(targetException);
logger.warn(() -> new ParameterizedMessage(
"{} Remote file corruption during finalization of recovery on node {}. local checksum OK";
shard.shardId(); request.targetNode()); corruptIndexException);





