版本: 7.14-8.9
简而言之,当您尝试从旧版本 Elasticsearch 创建的快照中恢复索引,而该快照与当前版本不兼容时,就会出现此错误。要解决此问题,您可以在创建快照之前将旧版本的 Elasticsearch 升级到与当前版本匹配,或者使用当前版本创建新索引并从旧索引重新索引数据。另外,您也可以将当前的 Elasticsearch 版本降级到创建快照时使用的版本。
日志上下文 #
日志 “cannot restore index [” + index + “] because it cannot be upgraded” 的类名是 RestoreService.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
snapshotIndexMetadata = convertLegacyIndex(snapshotIndexMetadata; currentState; indicesService);
}
try {
snapshotIndexMetadata = indexMetadataVerifier.verifyIndexMetadata(snapshotIndexMetadata; minIndexCompatibilityVersion);
} catch (Exception ex) {
throw new SnapshotRestoreException(snapshot; "cannot restore index [" + index + "] because it cannot be upgraded"; ex);
}
final String renamedIndexName = indexEntry.getKey();
final IndexMetadata currentIndexMetadata = currentState.metadata().index(renamedIndexName);
final SnapshotRecoverySource recoverySource = new SnapshotRecoverySource(
restoreUUID;





