Skip to content

feat(s3stream): support per-bucket CRT S3 clients - #3653

Merged
superhx merged 2 commits into
1.7from
feat/s3-crt-bucket-uri
Oct 13, 2026
Merged

superhx merged 2 commits into
1.7from
feat/s3-crt-bucket-uri

Conversation

@superhx

@superhx superhx commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Object-storage clients currently use Netty for every bucket. Operators need an opt-in CRT S3 client to tune connection health and transfer resources independently for data, WAL, and ops buckets without introducing process-wide mutable settings.

What

Add per-bucket SDK selection and tuning through camel-case BucketURI options. Netty remains the default and existing SDK API call and attempt deadlines remain available on the Netty path. Reuse the existing AWS SDK and CRT dependencies.

Each bucket uses an independent immutable configuration; CRT-only options are ignored by Netty. Disable CRT automatic multipart uploads with a fixed Long.MAX_VALUE threshold, preserving AutoMQ's explicit multipart uploads and request-level precomputed checksums. CRT S3 does not support the standard SDK API call/attempt deadlines.

URI option Default Behavior
sdkImpl netty Selects netty or crt.
connectionTimeoutMs 2000 Connection establishment timeout for either implementation.
numRetries 2 Retries per HTTP request, excluding the initial attempt.
maxConcurrency -1 Inherits AutoMQ's existing CPU-based client concurrency; explicit values affect the client cap, not the outer inflight quotas.
crtTargetThroughputInGbps 10 Per-client throughput target used for resource planning, not a bandwidth limiter.
crtMinimumThroughputInBps 33554432 Minimum healthy throughput per CRT connection.
crtMinimumThroughputTimeoutSeconds 2 Allowed low-throughput interval; values below two seconds are rejected.
crtMaxNativeMemoryLimitInBytes -1 Leaves native memory budgeting to CRT.

Reviewer notes

Read AwsObjectStorage.Configuration.fromBucketURI and newS3Client first to follow parsing and SDK construction. BucketURI declares the shared option names. AwsObjectStorageTest covers configuration isolation and propagation, including the fixed automatic multipart threshold.

Connection health thresholds can interact with intentional throttling or host contention. Native memory budgets and throughput targets are per client and must be considered across all clients in a broker. Equal retry counts do not imply identical backoff behavior between Netty and CRT.

@superhx

superhx commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Validation: all 15 AwsObjectStorageTest tests, s3stream Checkstyle and SpotBugs passed. Whole-repository rat/checkstyleMain/checkstyleTest completed successfully (rat is disabled by this branch). The prescribed spotlessJavaCheck task does not exist on 1.7; Javadoc was excluded from targeted tests because of an external Oracle TLS handshake failure. Devkit produce/consume and broker-restart checks passed. Additional CRT PUT/read-back tests against Devkit MinIO passed for MD5 and CRC32 at 32 MiB minus one byte, 32 MiB, and 33 MiB with automatic multipart disabled. Devkit README has no changes in this PR.

@superhx
superhx requested a balanced review from Copilot October 12, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@superhx
superhx merged commit 8d3ea77 into 1.7 Oct 13, 2026
7 checks passed
@superhx
superhx deleted the feat/s3-crt-bucket-uri branch October 13, 2026 07:12
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.

3 participants