You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I added unit test for the #17488, I found that Simultaneously creating a snapshot and updating the repository can potentially trigger an infinite loop to snapshot creation.
The reason is that when the repository is updated, RepositoriesService will create a new one to replace the old, and close the old one.
@kkewwei Not related to this PR, I wonder if we still update repository by closing and creating a new one, how could we update the internal state of the old repository?
Reloading some reposities won't have any effect. For example, initializing FsRepository will pull the setting from the env in addition to the repo metadata, please see those comments: #9569 (comment) #9569 (comment)
Describe the bug
When I added unit test for the #17488, I found that Simultaneously creating a snapshot and updating the repository can potentially trigger an infinite loop to snapshot creation.
The reason is that when the repository is updated,
RepositoriesService
will create a new one to replace the old, and close the old one.OpenSearch/server/src/main/java/org/opensearch/repositories/RepositoriesService.java
Line 493 in 3966ed9
But
creating a snapshot
still depend on the closed repository, which will trigger an infinite whensnapshot creation
.OpenSearch/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java
Line 661 in 3966ed9
The condition will always fail.

OpenSearch/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java
Line 682 in 3966ed9
Related component
Storage:Snapshots
To Reproduce
Put the unit test in
RepositoriesServiceIT
, and run it.Expected behavior
Fix the infinite loop.
I'm trying to fix it.
Additional Details
No response
The text was updated successfully, but these errors were encountered: