Skip to content
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

With the posix backend, uploaded parts are left in the ".sgwtmp" directory after CompleteMultipartUpload #626

Closed
cvubrugier opened this issue Jun 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cvubrugier
Copy link
Contributor

Describe the bug

Hi,

Thank you for creating and maintaining versitygw.
It is very nice and useful!

To Reproduce

  • Upload a file.
  • Go to the root directory of the posix backend.
  • Observe that in directory $bucket/multipart/object/upload-id, all parts (1, 2, ...) are left.

I identified the root cause and will contribute a fix.

In CompleteMultipartUpload, the path argument to os.RemoveAll() does not start with the bucket name. Since the path does not exist, os.RemoveAll() does nothing and uploaded parts are left in the ".sgwtmp" directory.

The issue exists in CompleteMultipartUpload but does not exist in AbortMultipartUpload.

Expected behavior

No parts should be left when CompleteMultipartUpload completes.

Server Version

$ ./versitygw --version
Version  : 1.0.1
Build    : d98ca9b0346d8f097ab42d8832895a248756259a
BuildTime: 2024-06-11T21:29:09Z

$ uname -a
Linux xxx 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux

Additional context
Reproduced with AWS CLI and Cyberduck

  • aws-cli 2.15.42
  • Cyberduck 8.9.0
@cvubrugier cvubrugier added the bug Something isn't working label Jun 12, 2024
cvubrugier added a commit to cvubrugier/versitygw that referenced this issue Jun 12, 2024
…load

In the posix backend, the path argument to os.RemoveAll() does not
start with the bucket name. Since the path does not exist,
os.RemoveAll() does nothing and uploaded parts are left in the
".sgwtmp" directory.

This commit prefixes the path with the bucket name.

Fixes issue versity#626.

Signed-off-by: Christophe Vu-Brugier <[email protected]>
@benmcclelland
Copy link
Member

Wow, even comes with a fix! thank you!

@cvubrugier
Copy link
Contributor Author

Not removing the uploaded parts also confused ListParts and ListMultipartUploads:

  • ListMultipartUploads listed completed multipart uploads in addition to in-progress multipart uploads.
  • ListParts listed parts for completed multipart uploads as well.

These issues are fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants