Repository navigation
Description
Independent verification update — 2026-09-06, round 2
The within-scope P1 recovery gap is verified fixed at #134 79ca3659652ec452fcc764544a467fda31f4fafe; keep open until merge. A fresh two-site TLS test reproduced the old published binary's damaged SSE-C replicas, then upgraded destination before source while preserving data and VersionIDs. The candidate repairs single-PUT replicas under destination default SSE-S3 and compression, and compressed multipart replicas. The already-readable default-SSE multipart control remains correct. All four plaintexts match their source, the original VersionIDs are preserved, wrong customer keys are rejected, and subsequent tag updates propagate.
- Permit authenticated raw replacement of the damaged old representation while retaining conditional requests and Object Lock ordering.
- Add the undecodable-version handler regression and rerun the real destination-compressed single-PUT recovery case.
- Reconcile fix: retransmit and re-order Object Lock for SSE-C replicas (single erasure set) #134 with current main, repair the encrypted null-version fixture and rebrand baseline, and pass integrated candidate checks.
- Merge fix: retransmit and re-order Object Lock for SSE-C replicas (single erasure set) #134 into maintained main.
The #136 final-counter flush fix is verified separately. A distinct remaining false-success accounting defect is now tracked in #139: when an existing replica rejects an update, its successful HEAD can still produce Completed / zero failures. Therefore resync status alone is not recovery acceptance; verify source replication status and destination data/metadata. Multi-pool Object Lock authority remains #133.
Problem
Every replication path except the first upload asks the target HeadObject before deciding what to
send. That HEAD carries no SSE-C customer key, so for an SSE-C object the target answers
400 InvalidRequest. The sender maps that answer to a metadata-only CopyObject, which the target
also rejects. The result is that once a non-empty SSE-C replica exists, tag, retention,
and legal-hold changes on the source do not reach it, a heal after a transient failure does not
retransmit, and mc replicate resync neither repairs the replica nor reports honestly, because a
second keyless HEAD counts every SSE-C object as a resync failure. First-time replication of a new
SSE-C PUT is unaffected, and a replica that is missing on the target is still healed correctly,
because a missing object answers 404 NoSuchKey. Two further shortcuts sit behind the first one: a full retransmit of
a multipart SSE-C object is rejected by the destination's duplicate version and ETag
precondition, and the sender converts that rejection into success, so no part is ever sent. All of
this is inherited from upstream: upstream/master is byte for byte identical at the lines below.
Reproduction and evidence
Two new signed-handler tests, ErasureSD and Erasure, versioned bucket, SILO main f0bd164b9, replay
the exact requests the replication sender issues.
TestAPISSECReplicationTargetHead:
| Request the sender makes | Observed on main |
|---|---|
| Keyless HEAD, sender headers only | 400 InvalidRequest, "The object was stored using a form of Server Side Encryption..." |
| Keyless HEAD on a missing key | 404 NoSuchKey, which is why a missing replica still heals |
| Keyless HEAD plus the internal replication marker | 200, Content-Length = plaintext size, ETag = last 32 bytes of the sealed ETag |
Metadata-only CopyObject built from getCopyObjMetadata, replica trusted, no key |
400 ExcessData |
The same CopyObject on a zero-byte SSE-C object |
200, because there is no data for the reader to overrun |
TestAPISSECReplicaWriteDuplicateVersionShortcut replays the full retransmit against a replica that
already carries the source version and ETag. The single-part PUT returns 200 and the write lands,
the zero-byte PUT likewise, and the multipart NewMultipartUpload returns 412 PreconditionFailed,
which cmd/bucket-replication.go:1650 turns into nil. In every case tested the object survived
unchanged: a GET with the customer key still returned the source plaintext.
Cause and minimal repair
On main f0bd164b9, cmd/bucket-replication.go:1461-1467 builds the target HEAD with no SSE-C key
and no internal replication marker, so cmd/encryption-v1.go:1029 rejects it. The sender then hits
cmd/bucket-replication.go:1502-1506, whose two assignments are both dead: line 1537 overwrites
rinfo.ReplicationAction with rAction, still replicateMetadata from line 1361, and line 1540
routes any action other than replicateAll into the metadata-only CopyObject at line 1582. That
copy is admitted by the trusted-replica exemption at cmd/object-handlers.go:1468, but the source
checksum cannot be decrypted, so a server-side CRC-64NVME is requested
(cmd/object-handlers.go:1602-1607), which clears metadataOnly (:1809-1811) and turns the
metadata copy into a data rewrite whose reader is sized from the decrypted size (:1560-1561,
:1646) while ReplicationRequest forces NoDecryption (cmd/erasure-object.go:257-259); the
reader overruns and line 1583 records replication.Failed. Forcing replicateAll instead is not
sufficient on its own: cmd/object-handlers-common.go:194-200 rejects a write whose PreserveETag
and VersionID both match, and only the single-part sealed ETag is truncated before that comparison
(cmd/encryption-v1.go:1051), so multipart SSE-C replicas match and are skipped. Introduced by
upstream ad04afe38 (2024-06-12, "Fix SSEC multipart checksum replication (minio#19915)").
Minimal repair, three hunks in two files. At cmd/bucket-replication.go:1502-1506 set
rAction = replicateAll in place of the two dead assignments, so an SSE-C replica that cannot be
described is retransmitted rather than metadata-copied. At cmd/object-handlers-common.go:194-200
exempt a trusted SSE-C replica write from the duplicate version and ETag rejection, so that
retransmit actually lands for multipart as well. At cmd/bucket-replication.go:3000-3005 set the
internal replication marker on the resync accounting HEAD when roi.SSEC; this corrects an SSE-C
accounting false negative only and is not evidence that anything was retransmitted. Out of scope:
adding the marker to the deciding HEAD at line 1461, which would also need the SSE-C ETag comparison
in getReplicationAction fixed to be worth anything; making the target accept a keyless
metadata-only copy; and general replication outcome accounting. The accepted cost is that every
update of an SSE-C object now retransmits its bytes. Size S, +25/-7 product lines.
Acceptance
- An existing SSE-C replica is retransmitted, not metadata-copied, on heal, existing-object, and metadata replication, single-part and multipart, and the run reports
Completed. - A tag, retention, or legal-hold change on an SSE-C source object reaches the target, asserted on the destination metadata and not only on the status, and the replica still decrypts to the source plaintext with the customer key.
- A multipart SSE-C replica upload over a matching version and ETag is no longer answered with
412, and the parts are actually sent. - The destination exemption is keyed on the incoming write, not the stored object: an incoming non-SSE-C replica write over an SSE-C destination is still rejected, and an incoming SSE-C replica write is exempted whatever the destination holds.
- Non-SSE-C behaviour is unchanged, including the
replicateNoneandreplicateMetadatapaths, ordinary duplicate version and ETag rejection, and explicitIf-MatchandIf-None-Match. -
mc replicate resyncon an SSE-C bucket reports replicated objects as replicated. - A destination that rejects the internal marker still behaves as before: the accounting HEAD fails and the object is counted as failed, with no change to the deciding path.
- Bounded recovery check for the [P1] SSE-C replicas become unreadable with destination default encryption or compression #109 damage, run once before any recovery instruction is published, covering single-part and multipart objects: two TLS sites, one bucket pair with destination default SSE-S3 and one with destination compression; damage the replicas, deploy the [P1] SSE-C replicas become unreadable with destination default encryption or compression #109 destination fix first, then show that (a) resync alone now retransmits and the destination GET with the correct key returns the source plaintext, and (b) deleting the damaged destination versions and resyncing also produces a correct replica, with a wrong key refused in both cases.
Deployment
The fix requires changes on both the sender and the destination. The sender change alters dispatch
and resync accounting; the destination exemption is what lets a multipart retransmit replace an
existing replica; and #109's destination fix must be deployed first, or a retransmitted replica is
transformed again the same way. Publish no recovery instruction until the bounded check in the acceptance list has run.
Related
Follow-up to #109, whose fix plan withdrew the resync recovery recipe because of this defect.
Upstream minio/minio carries the identical code. AWS documents that an
SSE-C replica is retrieved with the same customer key the source object used, so the destination
cannot decrypt or re-encrypt the body on its own.
Versions and verification
Found during the 2026-09-05 fix-plan triage of #109 on main f0bd164b9 (release
RELEASE.2026-09-03T13-18-01Z / 9b11dc946 for SILO, RELEASE.2026-09-03T07-13-05Z / a2ef95c0
for mcli). Verified by reading the sender path on main and by two new signed-handler tests that
replay the sender's exact HEAD, CopyObject, PUT, and multipart requests against a versioned bucket
on both backends; the sender-side decision itself was traced in code rather than exercised end to
end. Discussed with the Codex reviewer (gpt-6-astra) over three rounds; see the consensus record.
Activity
Vonng commentedon Sep 5, 2026
Progress record and escalation (2026-09-05)
Status: not merged. Three Codex rounds; one MAJOR finding remains, escalated to the maintainer. Branch
fix/issue-120-ssec-replica-retransmit(commit6fd1d7211, stacked on the #111 branchb2dca43fd), not pushed.What is done and Codex-clean. The core of this issue — making an existing SSE-C replica retransmittable and repairable — plus three of the four round-2 findings:
replicateAllselects a full retransmit when the keyless SSE-C HEAD cannot answer, instead of a metadata CopyObject that fails on any non-empty SSE-C object;putReplicationOptserrors now reportFailed, not a phantomCompleted.putReplicationOptsnow emits that timestamp whenever the reserved key is present (round-2 finding 4).The remaining MAJOR (Codex round 3), which needs your decision. #120 newly enables re-writing an existing SSE-C object version on the destination via a full PUT or multipart upload. Lock ordering is decided in the handler (read the destination version's lock state, order the incoming update against it), but the write commits later — for multipart, after the whole upload. So in active-active replication, if a newer legal hold
ON@10:00reaches the destination version after a retransmit was initiated withOFF@09:00, the retransmit's completion can roll the hold back toOFF. That is a WORM / legal-hold correctness gap. It is narrow (needs active-active, SSE-C, and a concurrent lock update landing inside the retransmit window) but legal hold is exactly what must never be silently dropped.Codex's smallest sufficient fix: perform the final lock-state comparison and merge under the namespace write lock that protects the version replacement, at the SSE-C replica PUT and multipart-completion paths (a general CopyObject refactor is not required). That is a cross-layer change into the erasure PutObject / CompleteMultipartUpload commit path, beyond this issue's minimal subject; the handler-level ordering here matches the bar Codex accepted for #111's CopyObject, but Codex distinguishes #120 because the multipart window spans the whole upload rather than a short handler operation. I agree the gap is real.
Options (maintainer's call):
My recommendation: option 1, because the gap is a legal-hold rollback. The three fixed findings and the retransmit mechanics are ready either way. The escalation is on this one point.
Vonng commentedon Sep 5, 2026
Escalation update (2026-09-06): the multi-pool lock-safe reconcile is unbounded
Following the maintainer's authorisation to do the commit-time Object Lock merge under the write lock, three further Codex rounds (4, 5, 6) each confirmed the same-version SSE-C retransmit is lock-safe on a single erasure set, but each surfaced a new way it is not lock-safe across multiple server pools:
PutObjectRetention/LegalHold.ModTimedoes not identify the newest lock state (retention and legal hold carry independent ordering timestamps and can leaveModTimeunchanged), so a resolver that picks one record byModTimecan return the older lock; the newest retention and legal hold can even live in different pools.ModTimetie, so the update is invisible despite completing.The branch is +2212 lines over the #111 base. Findings 1-3 are largely general multi-pool duplicate-version behaviour (shared pool-layer locking, per-field timestamp resolution, cross-pool stale-copy retirement), not specific to SSE-C retransmit. Making them fully correct is well beyond this issue's minimal subject.
Decision for the maintainer (the retransmit mechanics, exemption, accounting marker,
putReplicationOptsremoval, and the single-pool in-lock ordering are all Codex-clean):The implementer's single-pool safety assessment is being attached; branch is at
d900f40b7, not pushed, no PR.Vonng commentedon Sep 6, 2026
Fix record (2026-09-06): merged scope decided, PR open
Status: implemented, reviewed (Codex PASS, round 8), narrowed to single erasure set per the maintainer, awaiting merge. Pull request: #134 (branch
fix/issue-120-ssec-replica-retransmit, commit9e39aad80, stacked on the #111 branch — merge #111 first).What ships. The SSE-C replica retransmit (dispatch + duplicate-version exemption + resync accounting marker +
putReplicationOptsremoval/timestamp), and Object Lock ordering for the full replica write done under the object write lock at commit time (PutObject/CompleteMultipartUploadre-read the addressed version on the receiving erasure set — empty persisted multipart VersionID normalised to null — and re-order per field, honouring removals; absent version keeps the write's accepted lock; read errors fail the write). Marker-only and non-replica writes keep ordinary semantics.Scope decision. Correct for a single erasure set (the default). The multi-pool authoritative reconcile (shared pools-layer lock serialising with metadata mutations, per-field cross-pool timestamp resolution, cross-pool stale-copy retirement) is a general multi-pool replica-write concern, deliberately deferred and tracked in #133.
Adversarial Codex review (gpt-6-astra), eight rounds. 1-3: the ordering must survive a concurrent update (handler-level was insufficient); the maintainer authorised the commit-time write-lock merge. 4-6: drove out the multi-pool gaps (per-pool lock is the wrong boundary vs metadata mutations on pool 0's NSLock; object ModTime does not track per-field lock timestamps; a stale other-pool copy stays authoritative for reads) — establishing the full multi-pool fix is a distributed-systems project beyond this issue. The maintainer narrowed scope to a single erasure set. 7: a null-version completion looked up the latest version instead of the null version (fixed by normalising the empty persisted VersionID). 8: PASS, no findings.
Tests. Single-set: multipart and PUT interleave (newer hold survives), null-version completion (preserves the null version, leaves the UUID version), retransmit, exemption, target-head, retention-removal round-trip; #111 suite and object-layer regressions green; gofmt, go vet, golangci-lint clean.
Deployment. #109 (PR #122) first. Multi-pool limitation tracked in #133. No recovery instruction for #109-damaged replicas until the bounded recovery check runs.
fix: store raw SSE-C replicas verbatim on the destination
Vonng commentedon Sep 6, 2026
Independent functional review, 2026-09-06: #134 is not yet sufficient to close this issue.
Reviewed server main
e7d0e62f16ed8a2373a4e9f5c4639d62886c09f2, mcli mainbec94e4ef47f63d978e57f19091506d2090bd6c6, and #134 at9e39aad802f0d5a674648fb439411568bc5296c0. The live candidate was main + #134 in a disposable checkout, resolving only the duplicaterinfo.Err/Failedassignment conflict. No production fix was added to the candidate.P1: resync still cannot repair a destination-compressed single-PUT SSE-C replica.
I ran two real TLS loopback servers with separate data directories and KMS keys configured, bucket replication with proxying disabled, the same SSE-C customer key on source/destination GETs, and both single-PUT and multipart objects. Damage was created using the published
RELEASE.2026-09-03T13-18-01Zbinary. The destination was upgraded before the sender, preserving both data directories and object VersionIDs.XMinioObjectTamperedsio: unsupported version)The failing single PUT contains 196,608 plaintext bytes (
b'SILO raw SSE-C recovery\n' * 8192), uploaded assingle.txt; the source retains the correct plaintext. The sender logsunable to replicate ... The requested object was modified and may be compromised, and the destination GET with the correct key continues to fail after the resync has completed. Repeating the resync reproduces it. Deleting only the damaged destination VersionID in this disposable lab, then resyncing, restores the exact source bytes; that is a diagnostic control, not a general production recovery prescription.Root cause:
PutObjectHandlerinstallsopts.CheckPrecondFnwheneverPreserveETagis set. That callback callsDecryptObjectInfo(&oi, r)before the new raw-SSE-C duplicate-version exemption incheckPreconditionsPUT.DecryptObjectInfocallsoi.DecryptedSize(). The old destination hascompress(ciphertext)storage, so its stored length can be invalid as an encrypted stream. The replacement fails before it reaches the exemption. This is within the agreed single-pool scope; #133 does not explain or excuse it.The bounded fix needs to allow the authenticated raw replica replacement to reach commit without first requiring the damaged old body to have a valid decrypted length, while retaining explicit conditional headers and the commit-time Object Lock reconciliation. Add the destination-compressed single PUT to the regression tests, using a real source stream and an actually transformed old destination.
Integration checks also need repair before merging #134.
cmd/bucket-replication.go.Format, Build, Vetfails in rebrand-guard:headers compatibility set changed: + x-minio-replication-server-side-encryption(run). This is an allowlist update, not a Go compile failure.TestReplicaLockReconcileNullVersionfails in all four backend/subtest combinations before reaching completion. Its helper writes the four plaintext bytesdataunder SSE-C upload metadata; [P1] Replicated SSE-C multipart parts record the ciphertext length, corrupting part-number reads and later the object size #119 correctly rejects that invalid stream length. Usingsio.Encryptto construct the fixture makes these checks pass without changing product code or weakening [P1] Replicated SSE-C multipart parts record the ciphertext length, corrupting part-number reads and later the object size #119. In the combined fix: stop re-replicating an object whose retention was removed #131/fix: report effective bucket quotas in metrics #132/fix: retransmit and re-order Object Lock for SSE-C replicas (single erasure set) #134 review checkout, the existing targeted suite then passes (145 tests/subtests).The full unchanged main suites passed independently: server 5,566 tests/subtests; mcli 406. Those green suites do not cover the failed recovery case above. Keep #120 open and hold #134 pending the repair and the bounded recovery rerun. #109's prevention fix can remain closed; this is its outstanding recovery dependency.
[-][P2] An existing SSE-C replica is not updated or repaired: the target HEAD is keyless, the metadata copy fails on a non-empty object, and a multipart retransmit is silently skipped[/-][+][P1] Existing SSE-C replicas cannot always be updated or repaired[/+]fix: retransmit existing SSE-C replicas instead of metadata-copying them
fix: retransmit and re-order Object Lock for SSE-C replicas (single e…
docs: point the multi-pool lock follow-up at #133
fix: repair an undecodable SSE-C replica on retransmit
fix: repair an undecodable SSE-C replica on retransmit
fix: retransmit existing SSE-C replicas instead of metadata-copying them
fix: retransmit and re-order Object Lock for SSE-C replicas (single e…
docs: point the multi-pool lock follow-up at #133
fix: repair an undecodable SSE-C replica on retransmit
Vonng commentedon Sep 7, 2026
Resolved by #134 (merged to
mainas0af0907ef).Existing SSE-C replicas are now retransmitted (re-encrypted end to end) rather than metadata-copied, so an undecodable/compression-damaged replica can be repaired and Object Lock is re-ordered correctly on the replica. The single-PUT SSE-C overwrite path is no longer blocked by
CheckPrecondFnrunningDecryptObjectInfofor a trusted raw-SSE-C replica write that carries no conditional headers.Merge note: during the rebase, the commit that made the old
resyncBucketStatObjectprobe SSE-C-aware was dropped, because #139 (already onmain) had replaced that entire probe-based classification withresyncResultFor(...), which reads the actual replication outcome and is encryption-agnostic. All core retransmit changes were kept.Verified: Codex adversarial review (2 rounds, including a live two-site test), 14
TestAPISSEC*tests + resync-classification tests green, full acceptance on mergedmain.Scope narrowed to a single erasure set; multi-pool replica-write Object Lock reconciliation is tracked in #133.