Skip to content

Conversation

@abeyad
Copy link

@abeyad abeyad commented Jul 31, 2016

This PR encompasses work done to enhance the resiliency of snapshot repository blob handling. In particular:

  1. deleteBlob methods in the Repository interface now throw an IOException if the blob does not exist.
  2. Due to some test scenarios, this enhancement caused test failures, because blob names were based on the snapshot name (instead of snapshot UUID), which led to non-unique (i.e. mutable) blobs. So the deleteBlob change had to be accompanied by naming repository blobs by their snapshot UUIDs instead of snapshot names, which was part of the plan in Use UUIDs in working with snapshots #18156
  3. To consolidate all blob naming changes to one PR in order to avoid incompatibility issues, we also added the notion of an index ID (separate from the index UUID) used to name indices in the repositories indices folder, in order to prevent invalid characters in blob names as described in Escaping index name when creating a snapshot #7540

This PR is a combination of two other PRs:
#18815
#19421

Relates #18156

gfyoung and others added 17 commits July 22, 2016 13:48
Added BlobContainer tests for Azure storage
and caught a bug at the same time in which
deleteBlob was not raising an IOException
when the blobName did not exist.
Added BlobContainer tests for HDFS storage
and caught a bug at the same time in which
deleteBlob was not raising an IOException
when the blobName did not exist.
Makes deleting snapshots more robust by first deleting the
snapshot from the index generational file, then handling
individual deletion file errors with log messages instead of
failing the entire operation.
for reads and deletes if the blob does not exist.
to snapshot/restore) and the index to UUID mapping is stored in the
repository index file.
Azure and Google cloud blob containers, as the APIs for both return
a 404 in the case of a missing object, which we already handle through
a NoSuchFileFoundException.
upgrades if it determines the read data is in the legacy
format. It writes the upgraded version if it is not a
read-only repository and caches the repository data if
it is a read-only repository.
@abeyad abeyad added >enhancement :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v5.0.0-beta1 labels Jul 31, 2016
@abeyad abeyad self-assigned this Jul 31, 2016
logger.trace("deleteBlob({})", blobName);

if (!blobExists(blobName)) {
throw new IOException("Blob [" + blobName + "] does not exist");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a NoSuchFileException here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dadoonet Great catch, thanks! I will fix it before merging

instead of a vanilla IOException when the blob doesn't exist, in order
to conform to the BlobContainer's interface contract.
@abeyad
Copy link
Author

abeyad commented Aug 1, 2016

This PR has passed testing on CI twice as well as locally for me, so I'm merging and will monitor the builds over the next few days.

@abeyad abeyad merged commit 9f88a81 into master Aug 1, 2016
@abeyad abeyad deleted the enhancement/snapshot-blob-handling branch August 1, 2016 16:03
@abeyad
Copy link
Author

abeyad commented Aug 1, 2016

@gfyoung many thanks for your great work on getting this through!

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

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement v5.0.0-alpha5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants