Skip to content

Commit 8b5445d

Browse files
pmaxhoganclaude
andcommitted
docs(s3): explain why reusing an existing archive needs no size re-check
Neither copy path can publish a partial object (a single CopyObject is atomic; a multipart copy materializes only at CompleteMultipartUpload and aborts on any earlier failure), so an archive that exists is a whole one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xKUm9vH4ifb5LHR5szy1v
1 parent a42c0b6 commit 8b5445d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/driven-s3/src/store.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,12 @@ impl RemoteStore for S3Store {
16451645
content_token: &str,
16461646
) -> anyhow::Result<Option<String>> {
16471647
let dest = keys::version_key(&self.prefix, file_id, content_token);
1648+
// An archive that EXISTS is a whole archive, so its mere presence is
1649+
// enough to reuse it without re-verifying the size. Neither copy path can
1650+
// publish a partial object: a single `CopyObject` is atomic, and a
1651+
// multipart copy materializes the object only at
1652+
// `CompleteMultipartUpload` (and aborts its upload on any failure before
1653+
// that). The size check further down covers the copy this call performs.
16481654
if self.head(&dest).await.is_ok() {
16491655
tracing::debug!(
16501656
target: crate::TARGET,

0 commit comments

Comments
 (0)