-
Notifications
You must be signed in to change notification settings - Fork 2k
Enabling Support for Conditional Single-Part Upload [AWS S3] #18092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Enabling Support for Conditional Single-Part Upload [AWS S3] #18092
Conversation
❌ Gradle check result for f1c411e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Flaky Test : : #14509
|
plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Tanishq Ranjan <tqranjan@amazon.com>
e38f1fd
to
3951775
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18092 +/- ##
============================================
+ Coverage 72.53% 72.57% +0.03%
- Complexity 67132 67192 +60
============================================
Files 5474 5474
Lines 310173 310216 +43
Branches 45066 45072 +6
============================================
+ Hits 224993 225131 +138
+ Misses 66840 66743 -97
- Partials 18340 18342 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Adds
executeSingleUploadIfEtagMatches(...)
toS3BlobStore
, enabling support for conditional single‑part upload via the S3If-Match
header.onResponse
with the new ETag.onFailure
with anOpenSearchException("stale_primary_shard")
.IOException
and passed toonFailure
.Test Coverage
Precondition Failed (HTTP 412)
Setup: Mock
S3Exception
412Expectation:
IOException("Unable to upload object [<blob>] due to ETag mismatch")
OpenSearchException("stale_primary_shard")
onResponse
never calledGeneral S3Exception (HTTP 403)
Setup: Mock
S3Exception
403Expectation:
IOException("S3 error during upload [<blob>]: Access Denied")
(cause is the originalS3Exception
)onFailure
invoked (message contains blob name)onResponse
never calledSuccessful Upload
Setup: Mock
PutObjectResponse
with non-null ETagExpectation:
onResponse
receives that ETagonFailure
never calledSDK Exception
Setup: Mock
SdkException
Expectation:
IOException("S3 upload failed for [<blob>]", sdkException)
onFailure
receives thatIOException
Null ETag in Response
Setup: Mock
PutObjectResponse
witheTag == null
Expectation:
IOException("S3 upload for [<blob>] returned null ETag…")
onFailure
invokedonResponse
never calledNull or Empty Input/ETag
onResponse
gets returned ETag""
, zero-length blob: upload succeeds →onResponse
gets returned ETagBlob Size Limits
IllegalArgumentException("Upload request size [<size>] can't be larger than 5gb")
IllegalArgumentException
before any S3 interactionRelated Issue
Concerned RFC : RFC #17763
Parent Meta Issue : Meta #17859
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.