-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Probably when we updated Azure SDK, we introduced a regression. Actually, we are not able to remove files anymore. For example, if you register a new azure repository, the snapshot service tries to create a temp file and then remove it. Removing does not work and you can see in logs: ``` [2016-05-18 11:03:24,914][WARN ][org.elasticsearch.cloud.azure.blobstore] [azure] can not remove [tests-ilmRPJ8URU-sh18yj38O6g/] in container {elasticsearch-snapshots}: The specified blob does not exist. ``` This fix deals with that. It now list all the files in a flatten mode, remove in the full URL the server and the container name. As an example, when you are removing a blob which full name is `https://dpi24329.blob.core.windows.net/elasticsearch-snapshots/bar/test` you need to actually call Azure SDK with `bar/test` as the path, `elasticsearch-snapshots` is the container. Related to #16472. Related to #18436. Backport of #18451 in 2.x branch To test it, I ran some manual tests: On my laptop, create a file `/path/to/azure/config/elasticsearch.yml`: ```yml cloud.azure.storage.default.account: ACCOUNT cloud.azure.storage.default.key: KEY ``` Run `AzureRepositoryF#main()` with `-Des.cluster.routing.allocation.disk.threshold_enabled=false -Des.path.home=/path/to/azure/` options. Then run: ```sh curl -XDELETE localhost:9200/foo?pretty curl -XDELETE localhost:9200/_snapshot/my_backup1?pretty curl -XPUT localhost:9200/foo/bar/1?pretty -d '{ "foo": "bar" }' curl -XPOST localhost:9200/foo/_refresh?pretty curl -XGET localhost:9200/foo/_count?pretty curl -XPUT localhost:9200/_snapshot/my_backup1?pretty -d '{ "type": "azure" }' curl -XPOST "localhost:9200/_snapshot/my_backup1/snap1?pretty&wait_for_completion=true" curl -XDELETE localhost:9200/foo?pretty curl -XPOST "localhost:9200/_snapshot/my_backup1/snap1/_restore?pretty&wait_for_completion=true" curl -XGET localhost:9200/foo/_count?pretty ``` Then check files we have on azure platform using the console. Then run: ``` curl -XDELETE localhost:9200/_snapshot/my_backup1/snap1?pretty ``` Then check files we have on azure platform using the console and verify that everything has been cleaned.
- Loading branch information
Showing
3 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters