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

版本: 7.4-7.4

简要来说,当多个操作同时尝试修改 Elasticsearch 仓库时,会出现此错误。这种情况通常发生在清理操作启动时,而另一个操作仍在进行中。要解决此问题,可以实施队列系统来按顺序管理操作,确保清理操作仅在所有其他操作完成后才启动。另外,可以使用锁机制来防止并发修改。最后,可以增加超时设置,允许操作在清理开始前有更多时间完成。

日志上下文 #

日志 “concurrent modification of the repository before cleanup started;” 的类名是 BlobStoreRepository.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些需要深入了解上下文的用户参考:

throw new RepositoryException(metadata.name(); "cannot run cleanup on readonly repository");
 }
 final RepositoryData repositoryData = getRepositoryData();
 if (repositoryData.getGenId() != repositoryStateId) {
 // Check that we are working on the expected repository version before gathering the data to clean up
 throw new RepositoryException(metadata.name(); "concurrent modification of the repository before cleanup started; " +
 "expected current generation [" + repositoryStateId + "]; actual current generation ["
 + repositoryData.getGenId() + "]");
 }
 MaprootBlobs = blobContainer().listBlobs();
 final MapfoundIndices = blobStore().blobContainer(indicesPath()).children();