Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.8
Describe the issue:
I ran into this error while creating an index snapshot: org.opensearch.repositories.RepositoryException: [SNAPSHOT_REPO_NAME] concurrent modification of the index-N file, expected current generation [477] but it was not found in the repository
From the OpenSearch logs, I don’t see any concurrent operations, just some snapshot deletes from about 30 minutes before, and then this create snapshot failed. A few questions about this:
- What circumstances cause this error? From what I can see concurrent snapshot/restore is allowed, so what would cause a concurrent modification error?
- How can we prevent this from happening again? Should we be locking write to the index before creating a snapshot?
- Are create snapshot requests synchronous? They’re very fast, so I wonder how it’s possible to create a backup of large data within a few seconds.
Configuration:
Relevant Logs or Screenshots
{“type”: “server”, “timestamp”: “2025-12-05T00:04:21,769Z”, “level”: “WARN”, “component”: “o.o.s.SnapshotsService”, “cluster.name”: “CLUSTER_NAME”, “node.name”: “NODE_NAME”, “message”: “[SNAPSHOT_ID failed to finalize snapshot”, “cluster.uuid”: “CLUSTER_ID”, “node.id”: “NODE_ID” ,“stacktrace”: [“org.opensearch.snapshots.SnapshotException: [SNAPSHOT_REPO:SNAPSHOT_ID] failed to update snapshot in repository”,“Caused by: org.opensearch.repositories.RepositoryException: [SNAPSHOT_REPO] concurrent modification of the index-N file, expected current generation [477] but it was not found in the repository”,-
"Caused by: org.opensearch.repositories.RepositoryException: [SNAPSHOT_REPO] Could not read repository data because the contents of the repository do not match its expected state. This is likely the result of either concurrently modifying the contents of the repository by a process other than this cluster or an issue with the repository's underlying storage. The repository has been disabled to prevent corrupting its contents. To re-enable it and continue using it please remove the repository from the cluster and add it again to make the cluster recover the known state of the repository from its physical contents.",