Analyses / Object storage
Object ETags: checksums and conditional writes are different
Published 2026-10-12 / Updated 2026-11-30 / Primary-source synthesis
An ETag can select the object representation a client intends to update without being the checksum of the complete file. Conversely, a valid checksum does not stop a stale client from overwriting someone else's change. Treat validation of bytes and validation of a write's precondition as separate decisions.
On this page24 sections
Three questions, three different guarantees
| Question | Mechanism | Does not establish |
|---|---|---|
| Did these bytes match the expected bytes? | Checksum with a known algorithm, scope and trusted expected value | Which writer should win |
| Does this write still meet its condition? | Server-evaluated precondition on the target object | Application-level correctness or a cross-key transaction |
| What does a later read observe? | The service's consistency contract | An atomic GET-compute-PUT sequence |
Select an exact key before checking its bytes
An object key names the target within a bucket; the S3 version ID adds version selection where applicable. Keep the complete key, not just its last slash-separated component. S3 keys are case-sensitive, and the UTF-8 limit of 1,024 bytes includes prefixes and delimiters. [36] Name selection still does not verify downloaded bytes.
A key prefix selects a set. In a general-purpose bucket, Prefix=logs matches both logs/2026/a and logs-old/a; Prefix=logs/ excludes the latter. This is a worked consequence of literal prefix matching, not a live S3 observation. [37]
With Prefix=logs/ and Delimiter=/, a deeper key such as logs/2026/a is grouped under logs/2026/ in CommonPrefixes. That group counts once toward MaxKeys; its descendants are not separately returned in the same response. Check IsTruncated and continue with NextContinuationToken, an opaque token rather than an object key. Pagination of the grouped view still does not enumerate each group's contents. [38]
In general-purpose buckets, the console can display a folder from shared key prefixes. Its create-folder action writes a zero-byte marker ending in a slash. Neither a folder view nor a slash-ending key proves that every such object is an empty marker. [39] AWS's directory buckets instead use hierarchical directories. The flat-prefix interpretation here is not a claim about that bucket type. [40]
ListObjectsV2 with encoding-type=url percent-encodes returned key names for XML transport. An HTTP 200 OK alone does not establish a parseable listing; handle parsing errors before treating the response as an inventory. [38] Keep the response representation separate from the stored key.
For example, the encoded value report%252Ffinal decodes once to the literal key report%2Ffinal. Decoding again changes it to report/final, a different name. RFC 3986 warns against decoding the same string repeatedly. [41] Check whether the client has already decoded the response before applying a decoder; this is an encoding illustration, not a live S3 trace.
For a restore manifest, retain the bucket, exact keys and required version identities. ListObjectsV2 does not return VersionId; use ListObjectVersions for retained-version and delete-marker listings in general-purpose buckets. [38] [19] A prefix is a selection rule, and a grouped listing is a browsing result; neither is the identity of one file or evidence that its checksum was verified. This is documentation-derived guidance, not a multi-request snapshot guarantee.
Version listings have their own continuation protocol. When IsTruncated is true, pass the returned NextKeyMarker and NextVersionIdMarker as key-marker and version-id-marker in the next ListObjectVersions request. Use these markers, not the ListObjectsV2 continuation token. [19]
Service pages, command output and screen pages
Object-list pagination crosses interface boundaries. For a flat aws s3api list-objects-v2 listing without a delimiter, a service page and the CLI's capped output are different units. [45]
| Layer | Limit or switch | Continuation or effect |
|---|---|---|
| S3 API response | MaxKeys | IsTruncated: pass NextContinuationToken as ContinuationToken. [38] |
| CLI service calls | --page-size | Changes request size, not the total output limit. [45] |
| CLI capped output | --max-items | Resume with CLI NextToken and --starting-token; do not send that token directly to another interface. [45] |
| Automatic traversal | --no-paginate | Only one service request. [46] |
| Screen display | --no-cli-pager | Disables the display program, not service traversal. [46] |
MaxKeys is an upper bound, not a completion signal: check IsTruncated even when fewer keys are returned. Do not infer the end of traversal from the response size alone. [38]
AWS warns that different page and output limits can cause omissions or repetitions when service ordering varies, and suggests matching those limits or paging locally after a full retrieval. This addresses a pagination mismatch, not concurrent namespace changes. [46]
For a recovery inventory, retain the selection parameters, interface and unfinished continuation state. Treat an interrupted traversal as incomplete. These are engineering consequences of the controls above, not evidence that object bytes were verified or that several requests captured one atomic snapshot.
A useful contrast is the read protocol in the 2020 Delta Lake paper: LIST discovers log objects, then a checkpoint and subsequent add/remove records reconstruct membership for a selected table version. The directory listing itself is not the table state. [12, section 3.2.1] This is a historical protocol example, not a claim that S3 still has the paper's eventual-consistency behavior; current AWS documentation describes strong GET/LIST consistency. [5] The distinction remains between discovering object names and interpreting an application-level version.
ETag means validator, not a universal hash formula
HTTP defines an entity tag as opaque. A strong validator is not a promise of cryptographic strength, and a weak tag prefixed with W/ is not eligible for strong If-Match comparison. [1]
For S3, documented single-request PUT/POST/Copy cases using plaintext or SSE-S3 can have full-object MD5 ETags. SSE-KMS and SSE-C do not. Multipart Upload and Part Copy ETags are not the MD5 digest of the complete object, regardless of encryption. A hash-looking string alone is insufficient evidence. [2]
Dedicated checksum fields also require interpretation: FULL_OBJECT and COMPOSITE identify different coverage. A composite checksum is built from part checksums; it is not generally the result of hashing the downloaded file once. Record the type as well as the algorithm. [3]
Identical object bytes, different multipart values
The following local calculation follows the MD5 construction shown in AWS's multipart tutorial: hash each part, concatenate the raw digest bytes, hash that sequence and append the part count. Hashing hexadecimal text instead produces a different calculation. This is a documented example, not a universal ETag-generation rule. [4]
Synthetic input: Hesela storage (14 ASCII bytes). The tiny parts in the two-part examples are below S3 multipart minimum sizes. No network request or storage benchmark was run.
| Partition | Lengths | Whole-object MD5 | Tutorial-style multipart ETag |
|---|---|---|---|
| Split A: two parts | 7 + 7 | ac5980a8214ea2cf76e494a7f638adc6 | 51ba0db1c95870901e38295a3437765e-2 |
| Split B: two parts | 4 + 10 | ac5980a8214ea2cf76e494a7f638adc6 | 6df788a11cdd1908cabf429662c9651c-2 |
| One multipart part | 14 | ac5980a8214ea2cf76e494a7f638adc6 | 58e5a2b5fb3b3cbf3446cd8c0cf43ad5-1 |
The unchanged whole-object digest and changed multipart values isolate a boundary effect, not corruption. A one-part multipart construction also differs from a single PUT's full-object MD5. The part count alone cannot reconstruct where the boundaries were.
SHA-256: the same algorithm can check different inputs
A full-object checksum covers the complete byte sequence. A composite checksum combines part checksums. The label describes the calculation, not whether the transfer used one request or many: supported CRC full-object checksums can be combined from part results. Check the algorithm and type for the particular operation. [3]
For the SHA-256 composite construction in AWS's tutorial, hash each original part, concatenate the raw 32-byte digests in part order, then hash that sequence. Encode the final digest in Base64 and append -N, where N is the part count. Hashing the encoded digest text is a different calculation. [4]
Using the same synthetic bytes and partitions as above, the direct SHA-256 digest in Base64 is r+GlaeDcuuoRLrnR2Vr91i/1hcwsJJVnNVWE3PYVZhA= in every row. These are local arithmetic examples, not additional uploads.
| Part lengths (bytes) | SHA-256 composite (Base64-N) |
|---|---|
| 7 + 7 | 0j6kcOrLj1ZXgqBKj1F2AQg0FTdU8R9bVN6k/49kTKg=-2 |
| 4 + 10 | o3XEJMcF33z0gadYHvD90VBYrVRTE13atVHp7mLfnl4=-2 |
| 14 | fKU5FyPCBNzlj3o26TcjLg3zIamgKe8CFYpYgR1tLbc=-1 |
Removing the suffix or converting between hexadecimal and Base64 does not turn a checksum of part digests into a checksum of file bytes. Here the two-part results differ despite identical object bytes and part counts. A mismatch caused by comparing different scopes does not diagnose corruption.
Validate the whole hexadecimal checksum
A decoder can return the expected digest bytes without consuming the whole input. Hexadecimal byte encoding uses two characters per octet, with no padding. Letter case can vary; a canonical text profile must choose a case policy. Encoding a digest does not compute it. [55]
In the recorded Node v24.22.2 example, appending zz or one extra hex digit to the SHA-256 text for ASCII abc still returns the same 32 digest bytes. Checking decoded length and equality therefore misses the malformed suffix. This is documented decoder truncation, not a hash collision or a storage-service vulnerability. [56]
| Input text | Node Buffer.from | Python bytes.fromhex | Unseparated hex profile |
|---|---|---|---|
"0001" | 0001 | 0001 | Accept |
"AABB" | aabb | aabb | Accept |
"1a7" | 1a | ValueError | Reject |
"1ag123" | 1a | ValueError | Reject |
"0x12" | empty bytes | ValueError | Reject |
"aa bb" | aa | aabb | Reject |
"a b" | empty bytes | ValueError | Reject |
Python permits ASCII whitespace between complete byte pairs; it does not accept whitespace splitting the two digits of one byte. A profile forbidding separators must check that rule explicitly. [57] For an unseparated SHA-256 representation, require a string of exactly 64 ASCII hexadecimal characters before decoding. This illustrative profile accepts either letter case; a lowercase-only identity requires an extra rule.
Preserve zero bytes and byte order: 0001 encodes two bytes, whereas 01 encodes one. Interpreting the bytes as an integer is a separate operation. Complete syntax validation also does not establish the digest's provenance, object version, covered bytes or authenticity.
The reproducible 19-input API comparison uses synthetic strings, not a live object-store request. Download the observations and runtime versions, native probe and whole-input predicate, regression tests and replay instructions.
Which Base64 spelling does the checksum field require?
Base64 changes a byte sequence into text; it does not change what those bytes mean. For example, bytes fb ff become +/8= with the standard padded alphabet, or -_8 in an unpadded base64url profile. The URL alphabet and omission of padding are separate choices. JWS explicitly requires an unpadded form; that is not a rule for every Base64 field. [47] [48]
A decoder can accept more than one spelling of the same bytes. The unused bits in the last symbol are zero in canonical output, but RFC 4648 does not universally require decoders to reject nonzero unused bits. WHATWG's forgiving decoder deliberately discards them. Acceptance alone is therefore not a canonicality check or evidence of a defective decoder. [47] [51]
| Input text | Python hex | Node hex | Canonical? |
|---|---|---|---|
Zg== | 66 | 66 | Yes |
Zh== | 66 | 66 | No |
Zm8= | 666f | 666f | Yes |
Zm9= | 666f | 666f | No |
Zg | Rejected | 66 | No |
Z g== | Rejected | 66 | No |
+w== | fb | fb | Yes |
-w== | Rejected | fb | No |
Zh== and Zg== both decode to byte 66, but re-encoding that byte produces Zg==. Likewise Zm9= decodes to 66 6f, whose canonical padded spelling is Zm8=. Python's validate=True does not promise canonical pad bits. Node documents acceptance of both alphabets, so choosing its base64 decoder is not an alphabet-only gate. [49] [50]
For checksum verification, first parse the field's specified grammar, including any separate part-count suffix, then compare like-for-like digest bytes. If the protocol requires one canonical spelling, check that spelling explicitly. Do not decode an entire composite Base64-N value as base64url: its hyphen is a separator here, not a URL-alphabet symbol. Do not independently normalize text that a signature protocol requires to be preserved. These examples do not test which alternate spellings S3 accepts.
Fast decoding and strict spelling are separate contracts
The AVX2 study by Muła and Lemire treats unused-bit checks separately in Appendix A: an alphabet-valid tail can still be noncanonical. Lemire's 2026 SIMD study instead integrates ASCII-whitespace removal into its decoding loop. These are different acceptance policies, not competing definitions of correct Base64. [52] [53]
Even an option named strict needs its API context. ECMAScript's lastChunkHandling: "strict" rejects nonzero unused bits and incomplete final groups, but still skips ASCII whitespace. It is not an exact-spelling check for a field that forbids whitespace. Benchmark comparisons must also hold the alphabet, whitespace, padding and tail policies fixed. [54]
Reproduce the complete 16-input matrix with the decoder probe, regression tests and recorded results. The tests also enumerate the unused-bit variants of every one- and two-byte final group, plus an 8 MiB valid-input regression for the canonical checker. The checker uses native decode/re-encode and memory proportional to the input; it is not a streaming parser or a service resource limit. These checks test representation rules, not object integrity or authentication.
Declare the checksum before uploading parts
AWS documents an easy-to-miss case: if CreateMultipartUpload omits the algorithm, CRC32, CRC32C, SHA1 or SHA256 checksum headers supplied only to CompleteMultipartUpload are accepted but not validated or stored. Declare the intended algorithm at initiation; successful completion alone does not establish that this submitted checksum was checked. [3]
The initiation API exposes x-amz-checksum-algorithm and x-amz-checksum-type. Preserve those choices with the upload ID and verify the returned algorithm and type. [23]
Do not generalize the multipart-upload algorithm table to every operation. S3 Batch Operations can compute a full-object SHA-256 for stored data, although multipart upload supports SHA-256 as a composite checksum. Its report provides a new calculation to compare with a trusted baseline, not proof that a download was verified. [24] A batch manifest without version IDs targets the latest versions; inspect per-object success and failure results, and note that SSE-C objects are unsupported. [25]
Strong consistency still permits a lost update
S3 documents strong read-after-write consistency and atomic updates to an individual key, but concurrent unconditional writes use last-writer-wins semantics. There is no built-in atomic update across keys. Two clients can read the same state, compute different edits and then overwrite each other, even when each individual operation is strongly consistent. [5]
For PutObject, If-Match requests a write only when the current ETag matches the supplied tag; If-None-Match: * requests creation only when there is no current object. A failed condition yields 412; a concurrent conflicting operation can yield 409. [6]
Engineering consequence: after a conflict, re-read and reconcile or reject the proposed change. Merely fetching a new ETag and resending the old computed body can still lose the other client's edit. ETags are not monotonic generation counters; matching one is not proof that no intervening write occurred.
A content validator is not a metadata revision
S3 documents that an ETag reflects changes to object contents, not metadata. A metadata-only change is therefore outside the protection offered by comparing that content validator. Do not use a successful ETag comparison as evidence that every property consulted by your application is unchanged. [2]
A constructed example makes the distinction explicit: a client reads bytes and metadata, another writer changes only metadata, and the first client later submits a body computed from its old view. Comparing the content ETag alone does not validate that old metadata. This is a consequence of the documented scope, not a live S3 test. See compare-and-swap for the related distinction between comparing values and comparing revisions.
Identify the format, then validate the file
A stored Content-Type is a declaration, not an inspection result. S3 lets users set this system metadata, while its ETag describes content changes, not metadata changes. Retain the interpretation metadata alongside the bytes your application selected; do not infer that a version selector validates every metadata field. [62] [2]
A media type supplies a type, subtype and optional parameters. It differs from a filename extension and from Content-Encoding, which describes an applied coding such as gzip. Distinct media types can share the same data format while specifying different processing models: bytes alone cannot always recover the intended interpretation. A file signature is a byte pattern at a specified position; matching it does not inspect the rest of the file. [58] [59]
PNG makes the boundary concrete. The eight bytes 89 50 4E 47 0D 0A 1A 0A match the PNG rule in the MIME image-pattern table. A file containing only those bytes has no required chunks, including IHDR and IEND, so it is not a conforming PNG datastream. [61] [60]
| Input | Bytes | Prefix matches? |
|---|---|---|
| Signature only | 8 | Yes |
| One byte missing | 7 | No |
| One signature byte changed | 8 | No |
| Signature plus four zero bytes | 12 | Yes |
| Signature starts at byte 1 | 9 | No |
The prefix test deliberately ignores trailing bytes. These cases demonstrate an identification rule, not decoder behavior or a complete validation algorithm. Executable cases and regression tests use synthetic input. Byte positions in the table use zero-based offsets.
For an ingest or restore decision, record the declared type, the identification rule and the format checks actually completed. Parser acceptance does not establish conformance: for example, the MIME parser accepts text/html; even though that spelling fails the standard's writing rules. [63] Treat application acceptance and authenticity as separate requirements; neither a familiar extension nor a recognized prefix establishes them.
Successful validation need not select a unique format. Albertini et al. describe binary polyglots in which multiple formats coexist in the same bytes, unlike near polyglots that require byte changes. Their analysis examines format offsets, ignored data and embedded structures. This is a separate ambiguity from an incomplete PNG prefix, not a result measured by the table above. [64] For ingestion, record which format and consumer were checked; acceptance by one does not establish safety under every other interpretation.
Multipart completion is a decision point
CompleteMultipartUpload accepts these write conditions too. If it returns 409 ConditionalRequestConflict, AWS specifies a new multipart upload and re-upload of all parts, not just replaying completion with the old upload ID. The initial HTTP 200 can also contain an embedded error: raw clients must inspect the response body; AWS SDKs handle that case. [7]
An in-progress multipart upload does not reserve the destination key. In a versioned bucket, conditions concern the current version: a current delete marker allows If-None-Match: * even when older versions remain. A missing current object or delete marker makes If-Match fail with 404. [8]
Versioning retains recoverable versions. Our inference from that contract is that it does not merge concurrent edits or reject a stale writer on its own; retaining an overwritten version and preventing an overwrite are different policies. [11]
A version ID selects a revision, not a checksum
Record the bucket, key and returned VersionId together when a workflow must retrieve a particular S3 revision. Generated version IDs are opaque: do not sort them as timestamps or treat them as content hashes. Objects present before versioning was enabled keep their null IDs. [14]
The important exception is a suspended bucket's null version. A later write to the same key can replace its bytes while keeping that ID. An unchanged null identifier is therefore not evidence of an unchanged payload. Existing non-null versions are not replaced by that write. [15]
Version selection and write admission remain separate: versionId selects a GET target; the PUT If-Match condition discussed above compares an ETag, not that version ID. Keep both fields in their own roles. [9] [8]
A deleted key is not necessarily deleted history
A delete marker has an identifier but no payload. The documented GET response for a current marker is 404 when no version is selected, versus 405 when explicitly selecting the marker; both include x-amz-delete-marker: true. [17] Authorization errors can prevent these responses: a status code alone is not a complete inventory of retained data. [9]
| State and request | Effect | Recovery boundary |
|---|---|---|
| Enabled; no versionId | Adds a current delete marker | Existing data versions remain |
| Suspended; no versionId | Replaces any null version with a null delete marker | Null-version payload is lost; non-null versions remain |
| Enabled or Suspended; explicit versionId | Permanently removes that version; no new marker | Other versions do not reconstruct the removed version's unique content |
Inspect history with ListObjectVersions, not just ListObjectsV2; markers and data versions are distinct result entries. [19] Removing a current marker by its exact ID can expose an older data version. In an enabled bucket, another DELETE without an ID instead creates another marker. [18] Consequently, marker removal is not a guarantee of recovery if no data version remains or the next version is also a marker.
For recovery planning, distinguish an absent current object, a retained historical version and a permanently removed payload. Versioning does not replace a tested restore procedure. Corpus: object version ID, delete marker and object versioning.
A source deletion is not a replica deletion
In S3 general-purpose buckets, distinguish the deletion operation from the replication rule. The table uses V2 rules containing Filter. Legacy V1 rules without that element instead replicate user-created markers for matching keys. [42]
| Source operation | Replication effect |
|---|---|
| User DELETE without versionId | Marker replication is off by default in V2; eligible non-tag-based rules can enable it. [42] |
| DELETE with a specific versionId | The source version is removed; its deletion is not replicated to destination buckets. [42] |
| Lifecycle expiration creates a marker | The marker is not replicated, even with delete-marker replication enabled. [43] |
Tag-based rules do not support marker replication, and marker replication is outside S3 Replication Time Control's 15-minute SLA. [43] A current delete marker hides the key from ordinary GETs; it does not itself erase retained data versions. [17] Destination permissions and retention still matter.
Before deleting a source version, AWS recommends checking its replication status. With multiple destinations, the source reports COMPLETED only after replication succeeds to all destinations. [44] Recovery guidance inferred from these contracts: name the destination and intended version, then verify retrieval with the recovery identity. A recorded completion is not a restore test or a guarantee against later destination deletion. See object versioning and the backup acceptance checklist.
Research bridge: the commit is more than an uploaded file
Armbrust et al.'s Delta Lake paper separates new data objects from the log record that commits a table version. Its 2020 design writes data first, then atomically claims the next log position; readers use the log to determine table membership. Merely uploading valid bytes is not the table commit. [12, section 3.2]
The paper's statement that S3 lacked atomic put-if-absent is historical, not a description of today's S3 API: AWS announced conditional creation in August 2024. [13] This does not certify a present-day Delta deployment or imply that one conditional PUT implements its transaction protocol.
Engineering lesson: locate the publication decision and its conflict handling, rather than inferring transaction guarantees from object checksums or successful uploads. See storage consistency and transaction scope.
Keep the checksum attached to the right object
GetObject exposes checksum fields when checksum mode is enabled, with Base64 values and checksum-type metadata. Bind comparisons to the same object version, covered bytes, algorithm and type. A checksum retrieved as metadata is not evidence that the client has hashed its downloaded copy. [9]
Digest verification is not independent authentication. If both content and the expected digest can be replaced, an unprotected comparison can pass on the wrong content. A trusted integrity channel and an appropriate algorithm are still needed. [10]
Practical review: name the intended key or version, the write condition, the checksum coverage and the recovery decision separately. Preserve uncertainty when a request's outcome is unknown. See timeouts and retry identity and checksums, identity and lost writes.
Corpus records: entity tag, multipart upload, conditional write and object storage.
Verify the bytes received, not just the metadata
GetObjectAttributes can return checksums and original part sizes without returning object content. Its part list can be paginated. Combining those returned checksum values alone does not check the downloaded file: calculate from its bytes, using the original boundaries for a composite result. [21]
- Bind metadata and all reads to the same selected object version. A GET without
versionIdselects the current version; a range or part request retrieves only some bytes. Do not compare that partial payload's hash with a full-object checksum. [9] Anullversion ID does not provide an immutable pin; see the version-identity limitations above. - Record algorithm, type, encoding and expected size. For composite verification, collect every original part boundary in order, including subsequent metadata pages, and hash the received bytes rather than trusting the listed part digests. [21]
- Finish reading the response and handle validation failures before accepting the file. AWS SDK validation depends on supported algorithms and configuration; it can be skipped for unsupported algorithms, and a failure can surface while consuming the body. Successful response headers are not validation completion. [22]
A part count is not a complete part manifest
Request ObjectParts, ObjectSize and Checksum explicitly: unrequested attributes are omitted. This is metadata for the completed object, not a download of its bytes. [21] Keep every request on the selected non-null version where available; reusing the same key alone does not bind separate reads to the same version. [9]
| Field | Meaning and check |
|---|---|
IsTruncated | When true, continue listing. One successful page is incomplete. |
NextPartNumberMarker | Use the returned value as the next request's PartNumberMarker. |
TotalPartsCount | Total parts in the object, not the number returned on this page. Boto3 uses this name; the raw XML element is PartsCount. [67] [21] |
PartNumber and Size | Retain ordered part identities and each part's byte length. |
The pagination fields are defined by GetObjectAttributesParts; ObjectPart defines part identity and byte size. [65] [66] General-purpose buckets can omit Parts when no additional checksum was applied. Treat unavailable boundaries as missing evidence, not as a zero-part object. [65]
Engineering checks: require a completed listing, reject repeated part identities or an incomplete reported part count, and reconcile the ordered sizes with ObjectSize and received length. These checks establish the intended coverage, not integrity by themselves. Calculate the composite from the downloaded bytes at those boundaries, not just from returned digests. For a FULL_OBJECT checksum, verify the complete byte sequence directly; reconstructing the upload boundaries is unnecessary. See the scope comparison.
This is implementation guidance derived from the documented API boundaries, not a tested S3 downloader. The calculation module above deliberately has no network, authentication, pagination or version-selection logic.
Resume the same representation, not just the same URL
A byte-range request selects part of a representation. A server may ignore it and return 200. With If-Range, a nonmatching validator also removes the range restriction; a weak ETag is not allowed. Use an HTTP-date only when no ETag is available and that date qualifies as a strong validator. Never append a full response as the missing suffix.[27]
For a single-range 206, check Content-Range and received length against the intended interval. Range offsets address encoded bytes when content coding applies, not decompressed bytes. A 416 is not a completion certificate.[27]
S3 GetObject permits one range per request and documents If-Match and versionId, not If-Range. A nonmatching If-Match returns 412.[9] For versioned objects, select the same non-null version for every fragment; otherwise retain the original ETag as a precondition and stop on mismatch. The null-version exception still applies.
Engineering checklist: preserve the selected identity and coding, reject misplaced or truncated fragments, establish complete interval coverage, then verify the assembled file against the intended trusted checksum for the same byte representation. Successful fragments alone do not establish that result. This is protocol-derived guidance, not an executed downloader or S3 test.
When a small range becomes a whole-object transfer
Google Cloud Storage ignores Range during decompressive transcoding and sends the entire object. Its stored compressed bytes have a different checksum scope from the decompressed response. Accept-Encoding: gzip normally avoids transcoding, but Google documents a double-compression exception; object metadata with Cache-Control: no-transform prevents it. Check the actual response.[28]
The XML API can select a generation; its returned checksums cover the complete stored object, not an arbitrary requested interval.[29] Client-side automatic decoding is another boundary: preserve the bytes whose offsets and checksum you intend to validate. This is provider-specific documentation, not a measured transfer or an S3 behavior claim.
Selecting a generation fixes the stored data version, not its editable metadata. Content-Encoding and Cache-Control can change within that generation; metageneration tracks metadata revisions.[31] When those settings are part of the download contract, pair generation selection with x-goog-if-metageneration-match and check each response's coding before assembly. [29] This is an engineering consequence of the documented API, not a live-service experiment.
Complete decoded output is not a completed archive check
In Hesela's nine-case loopback experiment, curl 8.5.0 wrote all 2,048 expected decoded bytes before reporting a deliberately wrong gzip CRC with exit code 61. Requesting the same object's encoded bytes 0-2062 omitted its eight-byte trailer: curl again wrote all 2,048 decoded bytes, this time with exit code 0. The altered checksum was outside the returned interval.
The payload remained correct. This does not show a trusted decoded-content digest accepting changed application data. It separates decoded-content identity, encoded-object coverage and final client status. A file can exist with its expected length even when the client reports failure.
| Request | HTTP | Bytes sent | Bytes written | Exit |
|---|---|---|---|---|
| Full gzip, encoded output | 200 | 2071 | 2071 | 0 |
| Full gzip, decoded output | 200 | 2071 | 2048 | 0 |
| Encoded prefix 0-63 | 206 | 64 | 64 | 0 |
| Encoded suffix 64-2070 | 206 | 2007 | 2007 | 0 |
| Decoded, trailer excluded | 206 | 2063 | 2048 | 0 |
| Wrong CRC, full response | 200 | 2071 | 2048 | 61 |
| Wrong CRC, trailer excluded | 206 | 2063 | 2048 | 0 |
| Gzip media type only | 200 | 2071 | 2071 | 0 |
| Range ignored, full response | 200 | 2071 | 2071 | 0 |
Automatic decoding left the saved Content-Length: 2071 and Content-Encoding: gzip headers unchanged while writing 2,048 bytes. The same encoded body served as application/gzip without Content-Encoding remained 2,071 bytes. These observations match curl's documented distinction between a request header and enabling decoding. [32] [33]
The omitted trailer contains CRC32 and ISIZE. [34] Python's streaming zlib API also emitted the complete payload while its end-of-stream flag remained false; its whole-file gzip API rejected the truncated member. This is a second API check, not an independent compression engine. The curl 8.5.0 source was inspected as version-specific context. [35]
Joining the two raw ranges recreated the original encoded file exactly. A deliberately unchecked append of a full 200 response after a 64-byte prefix instead produced 2,135 bytes. That control tests application acceptance policy, not curl's --continue-at implementation. Keep output provisional until final status and the intended validation policy pass. Encoded archival and decoded-data ingestion need different expected hashes and byte counts.
Retained observations and SHA-256 hashes and the reproducible experiment package include headers, bodies, stderr, versions and tests. These are local HTTP/1.1 observations on a chosen fixture, not S3/GCS measurements, a benchmark, a vulnerability claim or a guarantee for every curl version.
Whole-object coverage is not whole-path coverage
Saltzer, Reed and Clark's 1984 paper follows a file from source disk through software, memory and network to destination storage. A network check cannot cover faults outside its endpoints. Lower-layer checks still help by reducing costly retries; they do not replace the application's final check. This is a systems-design argument, not a measured S3 failure rate. [26, pp. 2-4 of the linked reprint]
Applied here: a full-object digest names the bytes covered, while end-to-end protection names where the expected value is generated and verification finishes. A valid network download does not test a later local write. If the acceptance target is a durable local file, its write and recovery contract also needs verification. See backup verification and restore tests.
Arslan and Alhussen's FIVER preprint overlaps transfer and hashing through shared buffers. Its cache measurements expose a subtle limit: even a separate checksum pass can read the page cache, not the storage device. FIVER-Hybrid uses sequential verification for larger files to resemble the sequential baseline's cache behavior. Similar cache-hit patterns are not proof of power-loss recovery or complete detection of write faults.[30, sections III and IV.B]
Engineering implication: specify whether acceptance covers received buffers, filesystem readback or recovery after the intended fault. Do not equate another hash pass with an independent media read. This is source synthesis, not a reproduced benchmark.
Primary sources and limits
S3 deletion-replication scope and status sources reviewed 4 November 2026. Key and prefix sources reviewed 28 October 2026. The loopback decoding experiment and its RFC/curl sources were checked on 28 October 2026; the transcoding documentation and both endpoint papers were also rechecked that day. Range dates and Google Cloud Storage metadata/version boundaries reviewed 24 October 2026. GetObject, transcoding, FIVER and endpoint sources reviewed 23 October 2026. Checksum-scope, upload and download sources reviewed 16 October 2026; version-identity and deletion sources reviewed 15 October 2026. Earlier source dates remain listed below. S3-specific statements cover general-purpose buckets, PutObject, CreateMultipartUpload, CompleteMultipartUpload, GetObject, DeleteObject and ListObjectsV2 and ListObjectVersions, plus the separately scoped Batch Operations calculation; they do not certify other S3-compatible implementations, directory-bucket operations or CopyObject preconditions. Only the namespace contrast for directory buckets is noted above. The worked example is synthetic, not a live service test.
- RFC 9110: HTTP Semantics, sections 8.8.3 and 13.1.1
- Amazon S3 API: Object, ETag semantics and encryption exceptions
- Amazon S3: checking object integrity during upload
- Amazon S3: multipart upload with additional checksums, ETag verification example
- Amazon S3: data consistency model
- Amazon S3 API: PutObject, If-Match and If-None-Match
- Amazon S3 API: CompleteMultipartUpload, conditional conflicts and embedded errors
- Amazon S3: conditional-write behavior and current-version semantics
- Amazon S3 API: GetObject, ChecksumMode and checksum response fields
- RFC 9530: Digest Fields, section 6.1, integrity and authentication
- Amazon S3: using versioning in S3 buckets
- Armbrust et al. (2020), Delta Lake: High-Performance ACID Table Storage over Cloud Object Stores, PVLDB 13(12), 3411-3424; section 3.2; DOI 10.14778/3415478.3415560
- AWS, 20 August 2024: Amazon S3 now supports conditional writes
- Amazon S3: How S3 Versioning works, version IDs
- Amazon S3: Adding objects to versioning-suspended buckets
- Amazon S3 API: DeleteObject, versioning-dependent effects
- Amazon S3: Working with delete markers
- Amazon S3: Managing delete markers
- Amazon S3 API: ListObjectVersions
- Amazon S3: Deleting objects from versioning-suspended buckets
- Amazon S3 API: GetObjectAttributes, checksums, object parts and pagination
- AWS SDKs and Tools: data integrity protections and response-validation support
- Amazon S3 API: CreateMultipartUpload, checksum algorithm and type
- Amazon S3: Checking object integrity for data at rest, supported algorithms
- Amazon S3: Compute checksums, version selection, completion reports and limitations
- Saltzer, Reed and Clark (1984): End-to-End Arguments in System Design, ACM TOCS 2(4), 277-288; MIT reprint
- RFC 9110: If-Range, range requests, 206 and 416; sections 13.1.5, 14, 15.3.7 and 15.5.17
- Google Cloud Storage: gzip transcoding, double compression and Range behavior
- Google Cloud Storage XML API: object download, generation and checksum coverage
- Arslan and Alhussen (2018): Fast Integrity Verification for High-Speed File Transfers; arXiv:1811.01161v1, sections III and IV.B; DOI 10.48550/arXiv.1811.01161
- Google Cloud Storage: editable object metadata, generation and metageneration
- curl manual: --compressed, saved response headers and --range
- libcurl: CURLOPT_ACCEPT_ENCODING, manual headers and output-byte accounting
- RFC 1952: gzip member header and trailer, sections 2.3 and 2.3.1
- curl 8.5.0 source: gzip writer, inflate_stream and gzip_do_close
- Amazon S3: Naming objects, case, UTF-8 length and full keys
- Amazon S3: Organizing objects using prefixes and delimiters
- Amazon S3 API: ListObjectsV2, grouping and continuation
- Amazon S3: Console folders and zero-byte marker objects
- Amazon S3: Directory buckets and hierarchical namespaces
- RFC 3986, section 2.4: When to Encode or Decode
- Amazon S3: How delete operations affect replication
- Amazon S3: Replicating delete markers between buckets
- Amazon S3: Getting replication status information
- AWS CLI v2: list-objects-v2, output limits and CLI tokens
- AWS CLI v2: service pagination and the client-side pager
- RFC 4648: Base-N encodings, sections 3-5 and 10
- RFC 7515: JWS terminology, base64url encoding and signing input
- Python 3.12: base64.b64decode and validate
- Node v24.22.2: Buffer binary-to-text encodings
- WHATWG Infra: forgiving-base64 decode and discarded unused bits
- Mula and Lemire: Faster Base64 Encoding and Decoding Using AVX2 Instructions, Appendix A (2018)
- Lemire: Fast Forgiving Base64 Decoding with SIMD Instructions, section 4 (2026 preprint)
- ECMAScript: FromBase64 and SkipAsciiWhitespace
- RFC 4648: Base16 encoding, non-alphabet input and test vectors; sections 3.3, 8 and 10
- Node.js 24 Buffer: hexadecimal encoding and truncated decoding
- Python 3.12 bytes.fromhex: hexadecimal digits and ASCII whitespace
- RFC 9110: Content-Type and media types, sections 8.3 and 8.3.1
- RFC 6838: additional media-type identification information, section 4.12
- W3C PNG Third Edition: file signature and datastream conformance
- WHATWG MIME Sniffing: matching an image type pattern
- Amazon S3: system-defined object metadata
- WHATWG MIME Sniffing: MIME type writing and parser recovery
- Albertini et al., USENIX Security 2022: binary versus near polyglots and format characteristics, sections 4.2-4.4
- Amazon S3 API: GetObjectAttributesParts, pagination and missing part metadata
- Amazon S3 API: ObjectPart, part identity and byte size
- Boto3: get_object_attributes response structure and TotalPartsCount