Skip to content

Conversation

@mhl-b
Copy link
Contributor

@mhl-b mhl-b commented Dec 9, 2025

Add S3 ConditionalOperation enumeration for stronger type-check on mutually exclusive conditions: None, If-None-Match, and If-Match. https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html

@mhl-b mhl-b requested a review from DaveCTurner December 9, 2025 17:56
@mhl-b mhl-b added >non-issue :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Coordination Meta label for Distributed Coordination team labels Dec 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Production code looks good (one nit) but a couple of concerns about the test changes.

final boolean failIfAlreadyExists
final ConditionalOperation condition
) throws IOException {
try (var clientReference = s3BlobStore.clientReference()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this clientReference if we're going to acquire another one within putObject(...)

Comment on lines 161 to 162
if (failIfAlreadyExists) {
assertEquals("*", request.ifNoneMatch());
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work with the change to randomCondition()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed 2b71ea3

Comment on lines 375 to 376
if (failIfAlreadyExists) {
assertEquals("*", compRequest.ifNoneMatch());
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise I'm suspicious about this bit with the change to randomCondition().

@mhl-b mhl-b requested a review from DaveCTurner December 10, 2025 03:53
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM (I pushed 1bab786 to strengthen the tests slightly)

@DaveCTurner DaveCTurner enabled auto-merge (squash) December 10, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Coordination Meta label for Distributed Coordination team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants