nodecraft / b2-cloud-storage

Backblaze B2 Cloud Storage API Client. Implements all of the B2 Cloud Storage APIs, with helper methods for uploading files.
MIT License
42 stars 10 forks source link

b2_upload_file/b2_copy_file should cleanup already uploaded parts #5

Closed Cherry closed 4 years ago

Cherry commented 5 years ago

As title. If an upload/copy is cancelled, the already uploaded/copied parts aren't cleaned up, leaving dangling file parts in b2.

lclc98 commented 5 years ago

According to https://www.backblaze.com/b2/docs/large_files.html it says "If you have started a large file, but don't want to finish, you can use b2_cancel_large_file to delete all of the parts that have been uploaded so far." And looking at the code, it calls canceling large file or does it calling that not seem to clean up parts?

Cherry commented 5 years ago

It looks like you're right, thanks! I'll test and confirm as soon as I can.

Cherry commented 4 years ago

Whoops, I totally forgot about this issue! It does indeed look like we're cleaning up parts correctly for an upload. I'm not certain about cleaning up parts copied with b2_copy_part though, and the docs don't yield much insight - more investigation needed.

Cherry commented 4 years ago

I'm going to mark this as closed for the time-being. Everything looks good.