You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the 👍 reaction to show support for this feature.
Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
Subscribe to receive notifications about status changes and new comments.
Is your feature request related to a problem? Please describe.
\OC\Files\ObjectStore\S3ObjectTrait::writeMultiPart holds the Aws\Multipart\UploadState (containing the UploadId) as a local variable. The state is not persisted. When the PHP process terminates abnormally, the UploadId is lost.
The in-progress multipart upload remains on the S3 destination. Nextcloud has no reference to it. Subsequent MOVE/COPY/PUT attempts on the same source restart from part 0 and orphan the previous parts.
Describe the solution you'd like
Persist the UploadId, source-storage id, source internal path, and destination internal path at CreateMultipartUpload time. Store in oc_filecache_extended or an equivalent table.
On the next MOVE/COPY/PUT against the same source, writeMultiPart MUST look up the persisted UploadId. When present, reconstruct the UploadState via \Aws\S3\MultipartUploadingTrait::getStateFromService($client, $bucket, $key, $uploadId) and pass it to MultipartUploader via the state config option.
Delete the persisted record on CompleteMultipartUpload or AbortMultipartUpload.
Describe alternatives you've considered
Retry from part 0 on the next attempt. Wastes upload bandwidth equal to the completed part count.
Tip
Help move this idea forward
Is your feature request related to a problem? Please describe.
\OC\Files\ObjectStore\S3ObjectTrait::writeMultiPartholds theAws\Multipart\UploadState(containing theUploadId) as a local variable. The state is not persisted. When the PHP process terminates abnormally, theUploadIdis lost.The in-progress multipart upload remains on the S3 destination. Nextcloud has no reference to it. Subsequent MOVE/COPY/PUT attempts on the same source restart from part 0 and orphan the previous parts.
Describe the solution you'd like
Persist the
UploadId, source-storage id, source internal path, and destination internal path atCreateMultipartUploadtime. Store inoc_filecache_extendedor an equivalent table.On the next MOVE/COPY/PUT against the same source,
writeMultiPartMUST look up the persistedUploadId. When present, reconstruct theUploadStatevia\Aws\S3\MultipartUploadingTrait::getStateFromService($client, $bucket, $key, $uploadId)and pass it toMultipartUploadervia thestateconfig option.Delete the persisted record on
CompleteMultipartUploadorAbortMultipartUpload.Describe alternatives you've considered
MultipartUploader.ListMultipartUploads+AbortMultipartUpload. Cleanup pattern only, forfeits progress.Additional context
MultipartUploadingTrait::getStateFromServicereconstructsUploadStatefrombucket,key,uploadIdviaListPartspagination. Documented at https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.MultipartUploadingTrait.html.