Repository navigation
Description
Problem and reproduction
Complete a multipart object with a 5,242,880-byte first part and a 515-byte final part. Query GetObjectAttributes with ObjectSize,ObjectParts after enabling compression, SSE-C, or both. Use the correct customer key for SSE-C.
The complete GET and top-level ObjectSize are correct, but the returned part Size reflects the transformed bytes stored on disk:
| First-part mode | Expected Size | Observed Size |
|---|---|---|
| Compression | 5,242,880 | 125 |
| SSE-C | 5,242,880 | 5,245,440 |
| Compression + SSE-C | 5,242,880 | 288 |
The exact compressed sizes depend on the fixture, but must not replace the uploaded logical size. Plain objects are a passing control. Both ErasureSD and Erasure reproduce the incorrect fields on 0806 and 0903; all PUT/Complete/GET byte comparisons pass.
Cause and minimal repair
The response construction reads objInfo.Parts[i].Size directly. Compression/encryption logical size handling already exists in ListObjectParts. The original GetObjectAttributes implementation introduced this omission in 9b8ba97f9fc0a39ea6632443a102bd42f8067da3 (2024-01-05).
Use the logical part size, reusing existing ListParts transformation semantics and preserving compatibility with older object metadata.
Acceptance and scope
- Returned part sizes match the uploaded bytes for plain, compressed, SSE-C and combined objects.
- Cover both stored
ActualSizeand older metadata fallback behavior. - Complete GET, ObjectSize and ListParts remain consistent.
The fixture uses no additional multipart checksum. SILO returns Parts for these objects, and the reported Size must be consistent with its own GET/ListParts behavior. The ObjectPart API defines Size as the uploaded part's size.
Current mcli FULL_OBJECT verification was separately tested and still returns MATCH by reading the full object; it does not use this Attributes field. This issue tracks other callers that use part sizes for ranges or part boundaries.
Sparse part-number pagination is tracked separately in #115; this issue fixes returned logical sizes.
Versions and verification
Reproduced in the 2026-09-05 functional review on the published SILO release RELEASE.2026-09-03T13-18-01Z (9b11dc9469e650815b775cb47b039610644f5da4), with RELEASE.2026-08-06T00-00-00Z (3be10fcc1a44f6620ded0bd303461f9d688cca23) as the baseline. The reviewed code remains unchanged on current main f0bd164b92d799c026fb1a31ad8e0df8ecb39388. Product fixes have not been applied.
Activity
Vonng commentedon Sep 5, 2026
Fix plan prepared 2026-09-05 by Claude (Fable 5.1) and reviewed in 2 round(s) of dialogue with the Codex reviewer (gpt-6-astra) that filed this issue. Local paths under
/Users/vonng/pgsty/silo-codex-triage-20260905/silo-114(plan, prototype diff, tests, Codex transcripts) and/private/tmp/silo-mcli-review-20260905.MfP8W9(review evidence) live on the maintainer's machine, not in the repository.Fix plan — #114 (Claude ⨯ Codex consensus, 2026-09-05)
1. Verdict
Confirmed, and broader than the issue text.
GetObjectAttributesreports the on-drive partlength instead of the uploaded length for every compressed or encrypted multipart object. I read
the handler on main
f0bd164b9and ran the Codex repro test there: 12 size assertions fail acrosscompressed / SSE-C / compressed+SSE-C on both ErasureSD and Erasure, the
plaincontrol passes,and every PUT/Complete/GET byte comparison passes. The reviewed code is unchanged between release
9b11dc946and main, so the issue's line 715 is line 715 on main. Two corrections. First, theissue's proposed repair, "reuse the ListParts semantics and read
ActualSize", is notsufficient: for an SSE-C multipart replica
ActualSizeis itself the ciphertext length. Iconfirmed this by instrumenting the existing replication test, where a 122,880-byte plaintext part
is stored as
Size=122944 ActualSize=122944and the response returns<Size>122944</Size>against<ObjectSize>122880</ObjectSize>. Second, the per-partChecksum*fields are not affected,because
objInfo.decryptPartsChecksumsruns atcmd/object-handlers.go:687and part checksums aretaken over the client's plaintext (
cmd/object-multipart-handlers.go:882-895, andcmd/object-api-utils.go:1100calls that reader "the logical plaintext reader used for S3checksums"). Upstream has never fixed this:
upstream/master7aac2a2c5(2026-02-11) carries theidentical line. The mcli note holds:
reports/mcli.md:88-113showschecksum verifyreads thewhole object through
Core.GetObjectand never issues this request, so the blast radius isthird-party callers that derive part boundaries from this API.
2. Root cause
cmd/object-handlers.go:715on mainf0bd164b9fills the response withobjInfo.Parts[i].Size.ObjectPartInfocarries two lengths (cmd/xl-storage-format-v1.go:166-167):Sizeis "Size ofthe part on the disk",
ActualSizeis "Original size of the part without compression orencryption bytes". The handler picks the physical one, while the
ObjectSizeit returns twolines earlier is logical (
objInfo.GetActualSize()at:680), so the response does not even addup. Introduced by upstream
9b8ba97f9"feat: add support for GetObjectAttributes API (minio#18732)",2024-01-05;
git log --all -S "objInfo.Parts[i].Size" -- cmd/object-handlers.goreturns thatcommit and nothing else, and
827004cd6donly addedChecksumCRC64NVME. Codex's attribution iscorrect. A second, independent fact shapes the fix:
ActualSizeis not a trustworthy logicallength for encrypted parts. Replication uploads SSE-C parts as raw ciphertext with the ciphertext
length as Content-Length (
cmd/bucket-replication.go:1685,1708,1713), the receiving handler takesactualSize := size(cmd/object-multipart-handlers.go:849) and skips re-encryption for atrusted SSE-C replica (
:966), socmd/erasure-multipart.go:742persists the ciphertext lengthas
ActualSize. Parts written beforeactualSizeexisted record 0: SSE-C multipart arrived in120b06196(2018-03-01) andactualSizeonly ince9d36d95(2018-09-28), and main stillconverts such legacy metadata (
cmd/xl-storage-format-v2.go:915,cmd/xl-storage-format-v1.go:237).3. Minimal fix
cmd/object-handlers.go,getObjectAttributesHandler, inside the existingxhttp.ObjectPartsblock, plus one import ofgithub.com/minio/sio. 28 added lines, 1 changedline, no new helper, no new file, no storage or replication change. S.
ActualSizewhen it is
>= 0;actualSizewas added by the very commit that added compression, so it isalways present for a compressed part, and 0 is kept because it is the right answer for an empty
trailing part. An encrypted, uncompressed part derives the plaintext length with
sio.DecryptedSize(uint64(part.Size)), which is exact because each part is its own sio stream,and is precisely the arithmetic
ObjectInfo.DecryptedSizealready uses for objects with norecorded actual size (
cmd/encryption-v1.go:753-758); on error the storedSizeis kept. Everyother part keeps
Size, which is already logical. Deriving rather than trustingActualSizeiswhat repairs SSE-C replicas and legacy parts, and for well-formed objects the two agree exactly,
so nothing regresses. Each reported size is then the part's uploaded plaintext length, which is
what AWS means by
ObjectPart.Size; for a complete part listing with valid logical metadatathose sizes sum to
ObjectSize, while a paged response covers only the parts it returns,because the handler skips parts at or below the marker and stops at
MaxParts(
cmd/object-handlers.go:699,703).IsTruncated/NextPartNumberMarkerlogic atcmd/object-handlers.go:720-722, which is [P2] GetObjectAttributes pagination cannot finish with sparse multipart part numbers #115. (b) The per-partChecksum*fields, verifiedcorrect. (c) The replication write path that records a ciphertext length as
ActualSize: thatis a stored-metadata defect which also feeds
partNumberToRangeSpec, and it needs its own issueand its own regression, not a read-side patch. (d)
ListObjectParts, which describes in-flightuploads only and never the completed object this API describes, so it is left alone. (e) Whether
SILO should return a
Partssection at all for objects uploaded without an additional checksum.(f) Any metadata migration or rewrite of already-stored objects.
4. Tests
TestReview20260905AttributesMultipartLogicalPartSizefrom/private/tmp/silo-mcli-review-20260905.MfP8W9/silo-data/cmd/review_20260905_data_test.gowith consecutive part numbers{1, 2}, leavingthe sparse
{1, 3}variant to [P2] GetObjectAttributes pagination cannot finish with sparse multipart part numbers #115; it covers plain / compressed / SSE-C / compressed+SSE-C onErasureSD and Erasure. Add to
testAPISSECMultipartReplicationTrust(
cmd/replication-trust_test.go:640) aGetObjectAttributescall with the customer key,asserting the part size equals the plaintext length and equals
ObjectSize; today that testends at a GET byte comparison (
:829) and never looks at this response. Add a compressedmultipart case with an empty trailing part, asserting a reported size of 0.
ActualSize == 0. Under the rule abovethe encrypted branch never reads
ActualSize, so a zero there exercises no code path that thereplica assertion does not already cover.
TestAPIGetObjectAttributesAuthenticatesSSECKey,TestAPIGetObjectAttributesSSECReplicationAuthz,TestGetAndValidateAttributesOpts,TestAPIListObjectPartsHandler(itscompressed,encryptedandcompressed+encryptedsubtests),
TestAPIListObjectPartsHandlerPreSign,TestAPIReplicationTrustProtectsSSECReads,TestAPISSECMultipartReplicationTrust. All pass with the prototype.router (
cmd/api-router.go:307-311), nothing internal consumes its output, and the fix touchesno storage or replication code.
5. Compatibility, risk, rollout
The XML wire format is unchanged; only the value of an existing
Sizeelement is corrected, so noclient or SDK contract moves. Nothing is written to disk, so existing objects read correctly from
the next request with no migration, resync or healing. No replication path calls
GetObjectAttributesand the response drives no internal decision, so replication is unaffected.During a rolling upgrade a client can see the physical size from an old node and the logical size
from a new one, which is the existing wrong value on one side rather than a new failure mode.
Current mcli is unaffected. Two limits are deliberate and belong in the release note rather than
being papered over: a compressed part whose length was unknown at upload keeps its stored size, and
an SSE-C part that a buggy replication write also compressed cannot be recovered from either field.
Separately, this work uncovered that SSE-C multipart replicas persist the ciphertext length as
ActualSize;partNumberToRangeSpecconsumes that value and computed a range 64 bytes too long inthe single-part case I measured, harmless there because the range is clamped, but it warrants its
own issue alongside #113.
6. Cost
S. Product: 28 added lines and 1 changed line in one function, plus one import, all in
cmd/object-handlers.go. Test: theCodex repro test is about 100 lines and reusable as written minus the sparse part numbers, plus
roughly 25 lines added to the existing replication test and about 40 for the empty-trailing-part
case. Server repo only; no mc, Console, SDK or docs code change. Ordering: this diff touches lines
688 and 711-742 of
getObjectAttributesHandlerand deliberately does not touch the truncationblock at 720-722 owned by #115, so the two are adjacent but non-overlapping and can land in either
order.
7. Consensus with Codex
Rounds used: 2/3, Codex answered
CONSENSUS: YESin round 2. Agreed: validity, root cause andintroducing commit, the size-selection rule, test plan, scope and minimality.
Amendments accepted from Codex: (1) round 1, do not trust
ActualSizefor encrypted parts, derivewith
sio.DecryptedSize, which I confirmed necessary by instrumenting the existing SSE-Creplication test before accepting; (2) round 1, add the Attributes assertion to that replication
test and a compressed empty-trailing-part case, both prototyped; (3) round 1, narrow the
compatibility wording and drop the claim that the APIs universally agree; (4) round 2, state
correctness per part rather than as an unconditional sum, since a paged response returns a subset;
(5) round 2, the checksum-decryption citation is
cmd/object-handlers.go:687, not:686, which Iverified and corrected.
Rejected: Codex's round-1 request for a synthetic legacy fixture with
ActualSize == 0, becausethe revised encrypted branch never reads
ActualSize, so such a fixture exercises no code path thereplica assertion does not already cover with a real object. Codex withdrew this in round 2.
Open disagreements: none.
Appendix A — prototype diff
Before, main
f0bd164b9: repro test FAIL with 12 wrong part sizes; the SSE-C replica probe reports<Size>122944</Size>against<ObjectSize>122880</ObjectSize>. After: repro test PASS 8/8 withparts
{1, 2}; the replica probe asserts partSize == ObjectSize == 122880and passes; acompressed empty trailing part reports
Size0; the seven existing tests listed in §4 pass in thesame run.
gofmtandgo vet ./cmdare clean.Vonng commentedon Sep 5, 2026
Fix record (2026-09-05)
Status: implemented, reviewed, awaiting merge. Pull request: #128 (branch
fix/issue-114-115-object-attributes-parts, commitb5409ca11for this issue, followed by2cbd48a3cfor #115; based on mainf0bd164b9).Change.
getObjectAttributesHandlerreports each part's uploaded plaintext length: a compressed part usesActualSize; an encrypted, uncompressed part derives its length from the ciphertext withsio.DecryptedSize(ActualSizeis not trusted for encrypted parts because SSE-C replicas record the ciphertext length there, #119). One refinement over the plan, required by the adversarial review: only a part of an encrypted multipart object (crypto.IsMultiPart) or a single-part object is a stream of its own; a legacy encrypted object without the multipart marker is one continuous stream split into storage fragments and keeps its stored sizes. A part whose stored length is not a valid encrypted stream is answered withXMinioObjectTamperedrather than a fabricated size.Tests.
TestAPIGetObjectAttributesMultipartLogicalPartSize(adopted from the Codex repro; plain, compressed, SSE-C, compressed+SSE-C; consecutive and sparse parts; both backends), aGetObjectAttributesassertion in the SSE-C multipart replication test, a compressed empty-trailing-part case, and fixtures for the legacy single-stream and malformed-part predicates. Red on main, green with the fix; attributes, ListParts and replication-trust tests stay green; gofmt, go vet and golangci-lint clean.Adversarial Codex review (gpt-6-astra), one thread with #115. Rounds 1 and 2: FAIL (the encrypted-part predicate regressed legacy single-stream objects; the malformed-part path needed an explicit error; test-scope items). Round 3: PASS, no findings. Retained limitations recorded by the reviewer: legacy single-stream fragments and compressed parts with unknown
ActualSizestill report stored sizes.Vonng commentedon Sep 6, 2026
Merged — record complete (2026-09-06)
Merged via #128 (merge commit
e12e739a5) intomain. Supersedes the "awaiting merge" status above: main is green — siloe7d0e62f1, Go CI (Test cmd/, Test internal/, Race + S3 Select, Format/Build/Vet, Lint/Generated Files, Cross Compile) and VulnCheck all pass.Post-merge note. The
GetObjectAttributesencrypted-parts test added here was reconciled with #119's stricterPutObjectPartwrite validation via #135 (test-only, merged, main green): it now injects the pre-#119 on-disk shape through a stub object layer instead of writing plaintext parts under encrypted metadata. Handler behaviour and both assertions unchanged.Issue closed; fix record complete.
fix: report logical part sizes in GetObjectAttributes