-
Notifications
You must be signed in to change notification settings - Fork 34
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
Redundant API calls in Object.Attrs, elsewhere #37
Comments
Oh I see, getFileInfo can't be called without the fileId, which we don't have without another call first. However, downloadFileByName returns the X-Bz-Info-* headers, so we can populate object info from that. |
This is actually trickier than it looks. Not all the information (upload timestamp, status, specifically) is available from downloadFileByName. But I don't want to open with getFileInfo because identifying a 404 shouldn't be a class C op. |
(which is what list_files is, which is the only other way to get at the file ID when we don't already know it) |
You no longer need to ensure a file doesn't exist before uploading it (and that's impossible to do without race conditions anyway). Is this ticket still valid? |
That's an implementation detail for restic; B2 never required that test. This bug isn't so much about removing that test as it is determining that I'm not making two calls when one would suffice within blazer. For example, the Reader used to require a b2_get_file_info call to get the total object size before downloading it, but that was changed in #12. There may be others. |
Bah, I got confused and thought this ticket was in the restic repo 🙈 |
Hah, no worries. |
restic/restic#1383 is showing a lot of class B transactions.
Restic calls Attrs to ensure that an object doesn't exist before uploading it. This calls object.ensure, which populates the object ID and name, and then (on objects that exist) getFileInfo, to populate the Info field. This probably isn't necessary, although I'm not sure why object.ensure went from getFileInfo to downloadFileByName in the first place in 8b44fc9.
The text was updated successfully, but these errors were encountered: