-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Fix S3 deletion bugs #129891
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
Open
DaveCTurner
wants to merge
10
commits into
elastic:main
Choose a base branch
from
DaveCTurner:2025/06/23/s3-delete-container-unnecessary
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix S3 deletion bugs #129891
DaveCTurner
wants to merge
10
commits into
elastic:main
from
DaveCTurner:2025/06/23/s3-delete-container-unnecessary
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bug the first: `S3BlobContainer#delete` spuriously attempts to delete a blob named after the container, as if it were a directory in a filesystem. This makes sense for filesystem repositories but in S3 the blob key is an opaque string, may be a prefix of other blob keys, and can legitimately end in a `/`. We never create such a blob in the first place, but this was hidden because AWS S3 silently ignores these deletion requests, and also because... Bug the second: `S3HttpHandler` would delete extant blobs but ignore nonexistent blobs when processing a multi-object delete request. This is apparently how S3 behaves in practice but it's not documented as such so we cannot rely on it and must be stricter in our tests. Fixing this exposed... Bug the third: `S3BlobContainer#deleteBlobsIgnoringIfNotExists` wasn't actually ignoring `NoSuchKey` errors should any arise, and the S3 reference documentation does not proscribe this behaviour, so we must handle it properly.
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Hi @DaveCTurner, I've created a changelog YAML for you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Distributed Coordination/Snapshot/Restore
Anything directly related to the `_snapshot/*` APIs
Team:Distributed Coordination
Meta label for Distributed Coordination team
v9.2.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug the first:
S3BlobContainer#delete
spuriously attempts to delete ablob named after the container, as if it were a directory in a
filesystem. This makes sense for filesystem repositories but in S3 the
blob key is an opaque string, may be a prefix of other blob keys, and
can legitimately end in a
/
. We never create such a blob in the firstplace, but this was hidden because AWS S3 silently ignores these
deletion requests, and also because...
Bug the second:
S3HttpHandler
would delete extant blobs but ignorenonexistent blobs when processing a multi-object delete request. This is
apparently how S3 behaves in practice but it's not documented as such so
we cannot rely on it and must be stricter in our tests. Fixing this
exposed...
Bug the third:
S3BlobContainer#deleteBlobsIgnoringIfNotExists
wasn'tactually ignoring
NoSuchKey
errors should any arise, and the S3reference documentation does not proscribe this behaviour, so we must
handle it properly.