Skip to content

fix: don't fail PutObject when the metadata sidecar can't be written - #11

Closed
kilyanni wants to merge 1 commit into
masterfrom
fix/putobject-metadata-soft-fail
Closed

fix: don't fail PutObject when the metadata sidecar can't be written#11
kilyanni wants to merge 1 commit into
masterfrom
fix/putobject-metadata-soft-fail

Conversation

@kilyanni

@kilyanni kilyanni commented Jul 14, 2026

Copy link
Copy Markdown

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

@kilyanni
kilyanni requested a review from theduke July 14, 2026 14:00
@kilyanni

Copy link
Copy Markdown
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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 PutObject when save_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 thread src/storages/fs.rs
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
@kilyanni

Copy link
Copy Markdown
Author

Superseded by #12

@kilyanni kilyanni closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants