Browse Source

s3: listObjectParts return ErrNoSuchUpload if does not exist

ubuntu@prod-master-1:~$ aws --endpoint http://10.244.15.66:8333 s3api abort-multipart-upload --bucket prod-cache --key multipart-test --upload-id 5347f936-6adc-43de-8e5c-1fd137c3b2bc
ubuntu@prod-master-1:~$ aws --endpoint http://10.244.15.66:8333 s3api list-parts --bucket prod-cache --key multipart-test --upload-id 5347f936-6adc-43de-8e5c-1fd137c3b2bc
{
    "Initiator": null,
    "Owner": null,
    "StorageClass": "STANDARD"
}

If we abort a multipart upload, it appears that records are left behind. We should get a 404 NoSuchKey error.
pull/2632/head
chrislu 3 years ago
parent
commit
6cf2e7d493
  1. 4
      weed/s3api/filer_multipart.go

4
weed/s3api/filer_multipart.go

@ -270,6 +270,10 @@ func (s3a *S3ApiServer) listObjectParts(input *s3.ListPartsInput) (output *ListP
glog.Errorf("listObjectParts %s %s error: %v", *input.Bucket, *input.UploadId, err) glog.Errorf("listObjectParts %s %s error: %v", *input.Bucket, *input.UploadId, err)
return nil, s3err.ErrNoSuchUpload return nil, s3err.ErrNoSuchUpload
} }
if len(entries) == 0 {
glog.Errorf("listObjectParts %s %s not found", *input.Bucket, *input.UploadId)
return nil, s3err.ErrNoSuchUpload
}
output.IsTruncated = aws.Bool(!isLast) output.IsTruncated = aws.Bool(!isLast)

Loading…
Cancel
Save