Tags: AutoMQ/automq
Tags
fix(s3stream): abort upload part on NoSuchUploadException to prevent … …broker crash (#3418) ### Description When using AutoMQ with S3-compatible storage backends, a `NoSuchUploadException` can occur during an `UploadPart` or `UploadPartCopy` operation (e.g., if the multipart upload has expired, been aborted, or cleaned up by the backend). Previously, `AwsObjectStorage.toRetryStrategyAndCause` only handled `NoSuchUploadException` for `COMPLETE_MULTI_PART_UPLOAD` (mapping it to `RetryStrategy.VISIBILITY_CHECK`). For `UPLOAD_PART` and `UPLOAD_PART_COPY` operations, the exception fell through to the default `RetryStrategy.RETRY`. This caused an infinite retry loop, ultimately leading to a broker crash. This PR addresses the issue by mapping `NoSuchUploadException` to `RetryStrategy.ABORT` for both `UPLOAD_PART` and `UPLOAD_PART_COPY` operations. Since the multipart upload ID is no longer valid, aborting early prevents the crash loop. Fixes #3206 ### Testing Strategy - Added new unit tests in [AwsObjectStorageTest](file:///Users/divyanshuyadav/Downloads/automq/s3stream/src/test/java/com/automq/stream/s3/operator/AwsObjectStorageTest.java) to verify retry strategy mapping: - `testNoSuchUploadExceptionAbortsUploadPart` verifies `UPLOAD_PART` maps to `RetryStrategy.ABORT`. - `testNoSuchUploadExceptionAbortsUploadPartCopy` verifies `UPLOAD_PART_COPY` maps to `RetryStrategy.ABORT`. - `testNoSuchUploadExceptionVisibilityCheckForComplete` verifies `COMPLETE_MULTI_PART_UPLOAD` still maps to `RetryStrategy.VISIBILITY_CHECK`. - Ran the unit tests locally: ```bash ./gradlew :s3stream:test --tests "com.automq.stream.s3.operator.AwsObjectStorageTest" ### Committer Checklist (excluded from commit message) - [x] Verify design and implementation - [x] Verify test coverage and CI build status - [x] Verify documentation (including upgrade notes)
codex autobalancer decision trace query
PreviousNext