Skip to content

Add S3 multipart threshold configuration for object lock support - #10

Merged
f213 merged 1 commit into
masterfrom
claude/s3-compliance-lock-upload-w3v36t
Jul 27, 2026
Merged

Add S3 multipart threshold configuration for object lock support#10
f213 merged 1 commit into
masterfrom
claude/s3-compliance-lock-upload-w3v36t

Conversation

@f213

@f213 f213 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

This change adds support for S3 buckets with object lock (WORM/compliance lock) enabled by introducing a configurable multipart upload threshold. Buckets with object lock can reject CompleteMultipartUpload requests, so this feature allows uploads to be performed in a single request when the dump is small enough.

Key Changes

  • Added S3_MULTIPART_THRESHOLD environment variable (default: 5GB) to control when multipart uploads are used
  • Configured AWS CLI to respect the multipart threshold via aws configure set default.s3.multipart_threshold
  • Updated documentation with guidance on using object lock buckets and the importance of correct S3_REGION configuration
  • Set default threshold to 5GB (the maximum size of a single S3 upload) to avoid multipart uploads for most dumps

Implementation Details

  • The AWS CLI's multipart threshold is configured in backup.sh before any S3 operations
  • Users can override the default by setting S3_MULTIPART_THRESHOLD to a lower value (e.g., 8MB) to enable multipart uploads for smaller files
  • Documentation clarifies that S3_REGION must match the bucket's region to avoid unnecessary AuthorizationHeaderMalformed errors during retries

https://claude.ai/code/session_01KQwdZqNR3dWZi17tbSRq3j

Buckets with object lock enabled (e.g. Selectel compliance lock) answer
CompleteMultipartUpload with AccessDenied, so `aws s3 cp` fails for every
dump above the default 8MB multipart threshold.

Raise the threshold to 5GB — the maximum size of a single S3 upload — so
dumps go up in one request, and make it configurable through
S3_MULTIPART_THRESHOLD for anyone who wants the multipart behaviour back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KQwdZqNR3dWZi17tbSRq3j
@f213
f213 merged commit 548f431 into master Jul 27, 2026
1 check passed
@f213
f213 deleted the claude/s3-compliance-lock-upload-w3v36t branch July 27, 2026 13:01
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.

2 participants