Skip to content

fix: return the remote part checksum to federated UploadPartCopy - #72

Merged
Vonng merged 1 commit into
mainfrom
codex/issue-64-final
Aug 25, 2026
Merged

Vonng merged 1 commit into
mainfrom
codex/issue-64-final

Conversation

@Vonng

@Vonng Vonng commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • return the checksum persisted by the exact remote PutObjectPart write when the request carries the legacy federation minio-go application token
  • preserve ordinary external UploadPart response semantics and omit x-amz-checksum-type
  • keep the response ETag and checksum bound to one write under concurrent part overwrites
  • cover application-token parsing, the real minio-go response parser, concurrent overwrite behavior, and a two-deployment federation path for FULL_OBJECT and COMPOSITE uploads

Why

Legacy federation implements UploadPartCopy by forwarding copied bytes through minio-go Core.PutObjectPart. A checksum-enabled destination correctly computes and persists a missing part checksum, but an AWS-compatible ordinary UploadPart response omits a checksum that the request did not supply. The proxy therefore could not populate CopyPartResult.

The destination now exposes the PartInfo checksum only as a federation-specific response-shape hint. User-Agent is not used for authorization, visibility, or validation.

Compatibility and rollout

  • ordinary external UploadPart responses are unchanged
  • no storage format, import path, configuration, or public authorization contract changes
  • this does not create a rolling-upgrade compatibility path: the proxy-side checksum propagation from UploadPart requires a per-part checksum header that AWS S3 computes server-side #46 and this destination-side response fix have not shipped in an earlier release, so federation members must be upgraded together
  • federation member proxies and L7 intermediaries must preserve the minio-federated User-Agent application token; rewriting it safely degrades to the pre-fix missing-checksum behavior
  • rollback only reintroduces the legacy federation checksum gap

Verification

  • focused federation response, minio-go wire, concurrent overwrite, and two-deployment path tests
  • go test ./cmd -count=1 (138.335s on final tip)
  • focused federation tests under the race detector
  • go vet ./cmd and golangci-lint v2.13.1 on ./cmd/... (0 issues)
  • make rebrand-guard
  • gofmt and git diff --check
  • DCO sign-off verified; branch is exactly one commit over current main
  • independent local Claude Code adversarial review: no blocking findings; mergeable

The two-deployment fixture is confirmed to take the federation handler branch today. A direct remote-request counter would make that path assertion self-verifying and is left as non-blocking test hardening.

Fixes #64

The legacy etcd federation branch of CopyObjectPartHandler forwards copied
bytes with minio-go Core.PutObjectPart, which can only recover a checksum
from response headers. After the server-side part checksum work, the remote
computes and persists the checksum, but an AWS-compatible UploadPart response
correctly omits a checksum the request did not supply, so the proxy had
nothing to put in CopyPartResult.

The destination now returns the non-empty checksum fields of the PartInfo
produced by that exact write, but only when the request carries the
minio-federated application token that getRemoteInstanceClient already
attaches. Ordinary UploadPart responses are unchanged, and the checksum type
is deliberately not returned because UploadPart does not carry it. The
User-Agent is a response-shape hint only: it never gates authorization,
visibility or validation, and it can expose nothing beyond the checksum of
the body the caller just uploaded.

Reading the checksum from the same PartInfo that produced the response ETag
also keeps the pair bound to one write, so a concurrent overwrite of the same
part number cannot publish another writer's checksum.

Tests cover the application token gating matrix including lookalike tokens,
the real minio-go response parser, concurrent overwrites of one part number,
and an in-process two-deployment probe that drives the federation branch
through the real getRemoteInstanceClient into a real PutObjectPartHandler for
both FULL_OBJECT and COMPOSITE uploads.

Fixes #64

Signed-off-by: Feng Ruohang <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Vonng
Vonng merged commit 8d76a25 into main Aug 25, 2026
8 checks passed
@Vonng
Vonng deleted the codex/issue-64-final branch September 2, 2026 15:06
Vonng added a commit to mrjavadseydi/silo that referenced this pull request Sep 8, 2026
The legacy etcd federation branch of CopyObjectHandler forwards the copied
bytes with minio-go Core.PutObject but never asked the remote for a checksum
and discarded any it returned, so a cross-deployment whole-object copy that
requested a checksum returned 200 with an empty checksum, and a checksum-less
source did not gain the S3 default CRC-64NVME that the local path assigns. The
request was neither honored nor rejected. This is the whole-object counterpart
of pgsty#72, which repaired the same class of defect for federated UploadPartCopy.

When a server-side checksum is wanted -- explicitly requested, inherited from a
multipart source, or the CRC-64NVME default for a checksum-less object, all
already captured in dstOpts.WantServerSideChecksumType -- the forwarded
PutObject now streams a trailing checksum of that type, so the remote computes
and persists it and echoes it in the response. The value the remote reports for
that exact write is bound into objInfo.Checksum, matching how the local
CopyObject path carries checksums into the CopyObjectResult. Reading the value
from the same UploadInfo that produced the ETag keeps the pair bound to one
write.

Only the requested algorithm is returned; a malformed or absent remote value
leaves objInfo.Checksum unset, so an ordinary copy that wanted no checksum
still returns none. Two small mapping helpers convert between the server's
hash.ChecksumType and the minio-go request type and response field.

New end-to-end tests drive the real federation branch through
getRemoteInstanceClient and minio-go into a second in-process deployment and
assert that CRC32/CRC32C/SHA256/CRC64NVME and the no-algorithm default are all
returned in the CopyObjectResult and persisted on the destination, and that a
requested algorithm never leaks other algorithms into the response.

Fixes pgsty#99

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe
Signed-off-by: Feng Ruohang <[email protected]>
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.

Federated UploadPartCopy cannot reliably return the remote computed part checksum

1 participant