Repository navigation
Conversation
Open takes the response headers, including Content-Length and the ETag, from the object it stats, then streams the body. Ranged reads and parallel full reads send the statted S3 ETag as If-Match, but the direct full read, used for objects up to one download part and when download-concurrency is 1, did not. minio issues that GET on the first Read, so a key rewritten in between was served with the new body under the old revision's headers. The direct read now sends If-Match too, so a rewrite fails the read with S3's PreconditionFailed, as the other read paths already do. The soak test counts that error as a miss, like a delete between Open and Read. Signed-off-by: Ravi Agarwal <ravi@perplexity.ai> Co-authored-by: Perplexity <noreply@perplexity.ai>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
S3.Openstats the object, builds the response headers from that revision (Content-Length, the ETag and the stored headers), and then streams the body. Ranged reads and parallel full reads send the statted S3 ETag asIf-Match, so they never mix revisions. The direct full read doesn't. It serves every object no larger thandownload-part-size-mb(32 MiB by default), and every full read whendownload-concurrency = 1. minio sends that GET on the firstRead, so if the key is rewritten afterOpenreturns, the caller gets the new body with the old revision's headers, including aContent-Lengththat may not match it.Change
If-Match, likerangeGetReaderand the parallel windows. If the object was rewritten, the read fails with S3'sPreconditionFailedinstead of returning the other revision.cachetest.SoakcountsPreconditionFailedas a miss, the same way it already counts an object deleted betweenOpenandRead. Without this,TestS3CacheSoak(run withSOAK_TEST=1) fails intermittently on the new error, because 30% of its writes overwrite existing keys.Behaviour changes
Openand the firstReadreturns an error instead of the rewritten body. Ranged and parallel reads already do this.Testing
TestS3OpenPinsDirectReadsopens an object, rewrites it, and expects the read to fail withPreconditionFailed. It covers a small object anddownload-concurrency = 1. Onmain, both cases read the rewritten body without an error.Created with Perplexity