Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storagenode/blobstore: minor simplifications
In one case, we don't need to do an extra stat() call at the top of the function every time we trash a blob, since we os.MkdirAll() a descendant of that same directory a little bit further down. Any os.IsNotExist errors coming from the rename call are definitely talking about the source file, not the destination directory (unless of course the dest directory was deleted somehow concurrently, but that problem already existed so we're not making it worse). In the second case, we don't necessarily need special code to handle the possibility of a v0PieceAccess, because this is the blob store layer, which doesn't know anything about pieces. All blobs are blobs, to the blob store. (Even if that weren't the case, we only put FormatV1 blobs into the trash, so it still couldn't be a v0PieceAccess.) Add some extra info to diagnose the situation better if it ever happens. Change-Id: Idc2c2f79dbd2f6b9e4fdb28da19d0241d4596d47
- Loading branch information