Skip to content

fix: hybrid passthrough for Scylla manifest mid-frame range tail#123

Open
ServerSideHannes wants to merge 2 commits into
mainfrom
fix/scylla-manifest-hybrid-passthrough
Open

fix: hybrid passthrough for Scylla manifest mid-frame range tail#123
ServerSideHannes wants to merge 2 commits into
mainfrom
fix/scylla-manifest-hybrid-passthrough

Conversation

@ServerSideHannes

Copy link
Copy Markdown
Owner

Summary

  • 2026.7.15 still streamed because passthrough_blocked_reason=ranged_copy_segment_misaligned: Scylla sends bytes=0-4999341931 (~4767MB) but internal frames are ~8.33MB (50MB upload / 6), so the range ends mid-frame
  • Fix: _split_plaintext_range_on_segments → passthrough all complete ciphertext segments + re-encrypt only the trailing suffix (UPLOAD_PART_COPY_PASSTHROUGH_TAIL)
  • Logs streaming_tail_mb on passthrough events for diagnosis

Tests

  • test_split_plaintext_range_allows_hybrid_tail — split logic
  • test_scylla_prod_shape_* — uses prod exact range end 4999341931 + 8.33MB frames; expects 500+ upload_part_copy + 1 upload_part tail
  • 12/12 passthrough unit tests pass

Post-deploy

kubectl logs -n s3proxy-python -l app.kubernetes.io/name=s3proxy-python --since=30m \
  | rg 'UPLOAD_PART_COPY_ROUTE|UPLOAD_PART_COPY_PASSTHROUGH'

Expect route=passthrough, passthrough_blocked_reason=null, and streaming_tail_mb ~1MB on .sm_* manifests.

Made with Cursor

ServerSideHannes and others added 2 commits July 8, 2026 22:38
2026.7.15 logged passthrough_blocked_reason=ranged_copy_segment_misaligned:
manifest ranges (bytes=0-4999341931) end ~1.1MB into an 8.33MB encrypted
frame. Copy all complete ciphertext segments server-side and re-encrypt only
the trailing suffix instead of falling back to full streaming.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add request-scoped context (path, uploadId, partNumber) to MEMORY_*,
REQUEST_* and S3_ERROR_RESPONSE logs so prod 4xx/5xx are diagnosable
without guessing. Harden the postgres-style UploadPart path: map
InvalidPart/EntityTooSmall ClientErrors to 400, reject internal part
ranges past S3's 10k ceiling, detect truncated upload bodies, retry
Redis WATCH conflicts with backoff (25 attempts), and raise S3
read_timeout to 300s for slow seaweed uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant