Skip to content

feat(sdk): select OSS upload strategy by size#15

Merged
pfwang80s merged 1 commit into
mainfrom
pfwang80s/swift-oss-upload-e2e
May 28, 2026
Merged

feat(sdk): select OSS upload strategy by size#15
pfwang80s merged 1 commit into
mainfrom
pfwang80s/swift-oss-upload-e2e

Conversation

@pfwang80s
Copy link
Copy Markdown
Contributor

Context

The Swift SDK should keep using the official Alibaba OSS SDK, but it needs to choose PutObject or MultipartUpload from the file size instead of always exercising the multipart path.

What Changed

  • Add PutObject support to the Swift OSS session and route files with fileSize <= partSizeBytes through PutObject.
  • Keep files larger than partSizeBytes on the existing MultipartUpload path.
  • Persist enough state to resume PutObject uploads by checking remote object metadata before completing the business upload.
  • Update upload coordinator tests for small-file PutObject, exact-boundary PutObject, multipart, restart, and resume behavior.
  • Update real Aliyun integration tests so small and exact-boundary uploads reject multipart events while large uploads require multipart events.
  • Allow real Aliyun tests to override request timeout with DGW_REAL_REQUEST_TIMEOUT_SECONDS for 64 MiB+ payloads.

Validation

  • swift test --no-parallel
  • git diff --check
  • Dev ACK Swift SDK E2E: swift test --no-parallel --filter realAliyun with 9 real Aliyun tests passing, including runtime upload, list objects, PutObject events, exact-part-size PutObject events, multipart events, config-store upload, resume, abort/delete local snapshot, and device init/reinit upload.

Risks and Rollout

  • Risk: PutObject now becomes the default small-file path, so behavior changes from multipart-specific event streams to a single uploading-part event for small files.
  • Rollout or rollback: roll out as a Swift SDK update; rollback by reverting this PR to restore the previous multipart-only data path.

@pfwang80s pfwang80s merged commit 6b82c89 into main May 28, 2026
1 check passed
@pfwang80s pfwang80s deleted the pfwang80s/swift-oss-upload-e2e branch May 28, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant