Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove of azure files #117

Merged
merged 1 commit into from
May 27, 2016
Merged

Conversation

dadoonet
Copy link
Member

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 elastic/elasticsearch#16472.
Related to elastic/elasticsearch#18436.

Backport of elastic/elasticsearch#18451 for 1.7 series

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 elastic/elasticsearch#16472.
Related to elastic/elasticsearch#18436.

Backport of elastic/elasticsearch#18451 for 1.7 series
@dadoonet dadoonet added the bug label May 25, 2016
@dadoonet dadoonet added this to the 2.8.3 milestone May 25, 2016
@dadoonet dadoonet self-assigned this May 25, 2016
@dadoonet dadoonet modified the milestones: 2.8.4, 2.8.3 May 25, 2016
@dadoonet
Copy link
Member Author

@imotov Same here for 1.7 series. Could you look at it please?

@imotov
Copy link

imotov commented May 27, 2016

LGTM

@imotov imotov removed their assignment May 27, 2016
@dadoonet dadoonet self-assigned this May 27, 2016
@dadoonet dadoonet merged commit d4cf447 into elastic:es-1.7 May 27, 2016
@dadoonet
Copy link
Member Author

If anyone wants to test a SNAPSHOT version before we release:

bin/plugin --remove cloud-azure
bin/plugin --url https://oss.sonatype.org/content/repositories/snapshots/org/elasticsearch/elasticsearch-cloud-azure/2.8.4-SNAPSHOT/elasticsearch-cloud-azure-2.8.4-20160527.150319-1.zip --install cloud-azure

Then create a new repo, snapshot an index. Check on Azure that files are here.
The remove the snapshot. As it cas the only snapshot containing those files in the repo, all files should have been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants