fix: per-part copy memory reservation (Scylla backup 503 storm)#114
Merged
Conversation
Streaming UploadPartCopy held ~88MB for the entire multi-part pipeline, blocking concurrent copies on the 192MB budget. Acquire/release per 32MB chunk so memory is free during S3 I/O. Add unit + subprocess Prometheus tests including Scylla-shaped 1280MB concurrent copy load. Co-authored-by: Cursor <cursoragent@cursor.com>
c417226 to
8409141
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UploadPartCopynow acquires/releases governor memory per 32MB internal part (~88MB peak) instead of holding one reservation for the entire copy durationactive_mb=176backpressure when two concurrent 1280MB Scylla backup copies ran — memory is free during S3 upload I/O between partss3proxy_memory_reserved_bytessawtooth), and Scylla-shaped load (1280MB × 2 concurrent on 192MB budget)Test plan
pytest tests/unit/test_copy_per_part_memory.py— 6 passedpytest tests/integration/test_copy_per_part_metrics.py -m e2e -n0— 4 passed (incl. 1280MB Scylla load)make verify-copy-memory— pre-merge gatememory_copyshard (25min timeout for 1280MB workload)s3proxy_memory_reserved_bytessawtooth + 503 rate during Scylla backup windowPath to 100% confidence (post-merge)
s3proxy_memory_reserved_bytesmin/max during backup vs baseline (expect sawtooth, not flat ~176MB)min_over_time(s3proxy_memory_reserved_bytes[5m]) > 150MBduring copy-heavy periods = regressionUploadPartCopyshould drop during concurrent backup; no OOM restartsInvalidPartregressions (separate bug, not in scope here)Made with Cursor