-
Notifications
You must be signed in to change notification settings - Fork 25.6k
More resilient blob handling in snapshot repositories #19706
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
Conversation
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.
Snapshot UUIDs in blob names
| logger.trace("deleteBlob({})", blobName); | ||
|
|
||
| if (!blobExists(blobName)) { | ||
| throw new IOException("Blob [" + blobName + "] does not exist"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
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. |
|
@gfyoung many thanks for your great work on getting this through! |
This PR encompasses work done to enhance the resiliency of snapshot repository blob handling. In particular:
Repositoryinterface now throw an IOException if the blob does not exist.indicesfolder, in order to prevent invalid characters in blob names as described in Escaping index name when creating a snapshot #7540This PR is a combination of two other PRs:
#18815
#19421
Relates #18156