fix: don't fail PutObject when the metadata sidecar can't be written - #11
Closed
kilyanni wants to merge 1 commit into
Closed
fix: don't fail PutObject when the metadata sidecar can't be written#11kilyanni wants to merge 1 commit into
kilyanni wants to merge 1 commit into
Conversation
Author
|
A better long-term solution would be changing where metadata is written to, but I don't know enough about the current infra around that to make an informed decision on where that should be |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the filesystem-backed S3 storage implementation to make object metadata “sidecar” persistence best-effort, so PutObject can succeed even when the sidecar JSON cannot be written (e.g., when the filesystem root is read-only), aligning the API outcome with the fact that the object data file was written.
Changes:
- Stop failing
PutObjectwhensave_metadata()returns an error. - Add a
warn!log when metadata sidecar persistence fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
760
to
+764
| if let Some(ref metadata) = metadata { | ||
| trace_try!(self.save_metadata(&bucket, &key, metadata).await); | ||
| // The metadata sidecar lives at the fs-root, which may be read-only | ||
| // (e.g. an Edge volume is mounted at the bucket, not the root). The | ||
| // object itself is already written, so a failed sidecar write should | ||
| // not fail the whole PUT |
Author
|
Superseded by #12 |
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.
Currently, PUT fails with 500 when it fails to write to its metadata sidecar, even though the file itself uploaded.
Frankly, this is a bit of a band-aid, but the way this server stores metadata is quite weird (jsons at root, that also never get deleted when the file gets deleted), so this is an incremental improvement IMO, as it fixes stuff but breaks nothing atm I believe