You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reviewing #46 exposed a separate checksum-placement problem in CopyObject.
When CopyObject needs a server-computed destination checksum and destination compression is enabled, the current handler starts newS2CompressReader and later attaches AddServerSideChecksumHasher to srcInfo.Reader. That reader represents the storage stream, not necessarily the logical S3 plaintext stream. The compression goroutine can also begin consuming input as soon as it is created.
Static data-flow therefore indicates that the stored checksum can cover compressed bytes, or miss bytes consumed before the hasher is attached, instead of covering the logical destination object. This needs an API-level reproduction before the final patch is accepted.
Relevant code:
cmd/object-handlers.go: destination compression and AddServerSideChecksumHasher
cmd/object-api-utils.go: newS2CompressReader and PutObjReader
#46 will intentionally fix only UploadPart and UploadPartCopy. It will establish one shared internal invariant for later fixes:
PutObjReader retains a dedicated logical plaintext checksum reader, distinct from the storage reader.
A fallback server-side hasher is installed in the handler before compression or encryption can consume data.
The object layer validates the effective algorithm and persists the result.
The CopyObject fix should reuse that exact mechanism in a separate PR. It must not add a second checksum-reader abstraction or attach the hasher later in the object layer.
Problem
Reviewing #46 exposed a separate checksum-placement problem in CopyObject.
When CopyObject needs a server-computed destination checksum and destination compression is enabled, the current handler starts newS2CompressReader and later attaches AddServerSideChecksumHasher to srcInfo.Reader. That reader represents the storage stream, not necessarily the logical S3 plaintext stream. The compression goroutine can also begin consuming input as soon as it is created.
Static data-flow therefore indicates that the stored checksum can cover compressed bytes, or miss bytes consumed before the hasher is attached, instead of covering the logical destination object. This needs an API-level reproduction before the final patch is accepted.
Relevant code:
Relationship to #46
#46 will intentionally fix only UploadPart and UploadPartCopy. It will establish one shared internal invariant for later fixes:
The CopyObject fix should reuse that exact mechanism in a separate PR. It must not add a second checksum-reader abstraction or attach the hasher later in the object layer.
Proposed direction
Acceptance criteria
This issue is deliberately separate from #46 so the multipart P0 can be reviewed, released, and rolled back independently.