Skip to content

fix: serialize CompleteMultipartUpload across HA pods - #148

Merged
ServerSideHannes merged 2 commits into
mainfrom
fix/complete-multipart-upload-lock
Jul 31, 2026
Merged

fix: serialize CompleteMultipartUpload across HA pods#148
ServerSideHannes merged 2 commits into
mainfrom
fix/complete-multipart-upload-lock

Conversation

@ServerSideHannes

Copy link
Copy Markdown
Owner

Summary

  • Add CompleteUploadLock (Redis or in-memory) so only one pod can finalize a multipart upload at a time.
  • Return idempotent success when metadata and assembled object already exist (peer pod finished first).
  • Wrap handle_complete_multipart_upload in the lock to prevent concurrent upstream CompleteMultipartUpload races.

Fixes prod incident where Scylla backup uploads failed with NoSuchUpload after s3proxy pods raced on complete during a rollout.

Test plan

  • tests/unit/test_complete_upload_lock.py — concurrent complete serialization, idempotent peer-finished path, lock timeout
  • Existing complete recovery/retry tests still pass locally
  • CI unit + integration jobs

Made with Cursor

ServerSideHannes and others added 2 commits July 31, 2026 13:42
Concurrent complete requests for the same upload_id on different pods
caused duplicate upstream CompleteMultipartUpload calls and NoSuchUpload
failures on large Scylla backup uploads. Add a Redis/memory per-upload
lock, idempotent complete when metadata and object already exist, and
unit tests for serialization and peer-finished paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ServerSideHannes
ServerSideHannes merged commit 27b77cf into main Jul 31, 2026
11 checks passed
@ServerSideHannes
ServerSideHannes deleted the fix/complete-multipart-upload-lock branch July 31, 2026 11:53
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