Concurrent modification of the repository before cleanup started – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.4-7.4

Briefly, this error occurs when multiple operations are trying to modify the Elasticsearch repository simultaneously. This can happen when a cleanup operation is initiated while another operation is still in progress. To resolve this issue, you can implement a queue system to manage operations sequentially, ensuring that cleanup operations are only initiated after all other operations have completed. Alternatively, you can use a lock mechanism to prevent concurrent modifications. Lastly, you can increase the timeout settings to allow operations more time to complete before cleanup begins.

This guide will help you check for common problems that cause the log ” concurrent modification of the repository before cleanup started; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: repository, repositories, blobstore.

Log Context

Log “concurrent modification of the repository before cleanup started;” class name is BlobStoreRepository.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 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() + "]");
 }
 Map rootBlobs = blobContainer().listBlobs();
 final Map foundIndices = blobStore().blobContainer(indicesPath()).children();

 

 [ratemypost]