Skip to content

Resume S3 MultipartUpload across PHP process boundaries via persisted UploadId #62649

Description

@TobyTheHutt

Tip

Help move this idea forward

  • 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.
  • Client-side chunked-upload resume (PR #27034). WebDAV Chunk-v2, client-driven, unrelated to server-side MultipartUploader.
  • Same-request retry with reduced concurrency (PR #53580). Bounded to a single PHP process, does not survive process death.
  • Orphan reap via scheduled ListMultipartUploads + AbortMultipartUpload. Cleanup pattern only, forfeits progress.

Additional context

Activity

  1. added
    0. Needs triage
    on Jul 29, 2026
  2. added
    hotspot: file transfers
    on Sep 7, 2026
  3. susnux commented on Dec 2, 2026

    @susnux
    Contributor

    Still valid on master: S3ObjectTrait::writeMultiPart() keeps the upload state only for the current request and aborts it on failure. This affects server-side writes such as cross-storage moves and copies; client chunked uploads (chunking v2) already persist their upload id. Note that a retried write usually targets a new object key (urn:oid:<fileid>), so a resume mechanism also needs to reuse the previous target key.

  4. added
    1. to develop
    and removed
    0. Needs triage
    on Dec 3, 2026
  5. moved this from To triage to Confirmed in 🧑‍🤝‍🧑 Server Community triageon Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developenhancementfeature: object storagehotspot: file transfersperformance 🚀

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions