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

版本: 7.11-7.13

简要来说,当 Elasticsearch 无法删除段文件中未引用的文件时,会出现此错误。这可能是由于权限不足、文件被锁定或磁盘空间问题导致的。要解决此问题,您可以检查并调整文件权限,确保没有进程锁定该文件,或释放磁盘空间。此外,如果问题是暂时的或由故障引起的,重启 Elasticsearch 节点可能会有所帮助。

日志上下文 #

日志 “Failed to remove files not referenced in segment file [” 的类名是 FileRestoreContext.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:

final String indexStoreType = INDEX_STORE_TYPE_SETTING.get(store.indexSettings().getSettings());
 if ("snapshot".equals(indexStoreType) == false) {
 Lucene.pruneUnreferencedFiles(restoredSegmentsFile.name(); store.directory());
 }
 } catch (IOException e) {
 throw new IndexShardRestoreFailedException(shardId; "Failed to remove files not referenced in segment file ["
 + restoredSegmentsFile.name() + "] after restore"; e);
 }  /// now; go over and clean files that are in the store; but were not in the snapshot
 try {