A copy stores a per-chunk-encrypted chunk's ciphertext as-is, so a replica
whose needle is cut short or diverged became the copied chunk unnoticed.
Open the GCM tag of a whole-needle read and fail that replica when it does
not authenticate; a compressed ciphertext has no expected length to check.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: read a copy's source chunk from another replica when one cannot serve it
CopyObject and UploadPartCopy looked up the source volume and always read
from the first location the lookup returned. When that replica could not
serve the chunk (it was down, or it was missing a needle the other replicas
hold), the copy failed with 500 even though the object was fully readable:
GET falls back to the other replicas, copy did not.
Keep every location from the lookup and try them in order:
- the streaming path opens the source on the first replica that answers
with the chunk. It only moves to the next replica before any byte has
been forwarded to the destination.
- the buffered path (encrypted or rewritten chunks) retries the whole
download on the next replica and discards a partial read.
When no replica can serve the chunk the error lists what each one answered.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* s3api: try the next replica when a buffered copy read comes back short
A replica holding a shorter needle answers the range clamped, with a
clean end, so the download looked complete and the copy kept the short
data instead of reading the healthy replica. Plaintext reads now need the
full requested length; cipher chunks are still checked by decryption.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: skip a replica whose streamed copy source is shorter than the chunk
The streaming path checked only the status, so a replica holding a shorter
needle had its clamped range forwarded and the destination stored a short
chunk. An uncompressed response that declares fewer bytes than requested
now moves on to the next replica before anything is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>